How to Create a Cron Job to SCP events.data files to a Server Folder

Hi,

I am still a relative novice so please bear with me, and if anyone has any suggestions for me I greatly appreciate it! I manage a small network of about 30 macintosh computers with about 50 users using os x 10.6 server as an od master. About 2 thirds of my users are "network accounts" with the remaining users on local machine accounts. The local users also have a network login that they use for authenticating to our filemaker programs and for access to shared network folders. Recently I have started to manage the client computer preferences via the workgroup admin app. I have recently enabled time limits on certain groups, added a "managers" group as local admins (using dsedit) on some managed computers to allow for the extension of these time limits by authorized managers. I also enabled content filtering and web logging on a group of managed computers.(side note: I noticed that if a local account has parental controls activated then the machine preferences are ignored and the local settings are used so I have disabled the local parental controls) I followed the instructions in this article http://support.apple.com/kb/HT4672?viewlocale=en_US http:// to enable the web-logging on the client computers. What I would like is to create a cron job to run a script that will copy (scp?) the events.data file to my server or even my local workstation. I encountered permission issues with trying to access the events.data files stored on the local client machines. I chown on the "users" folder in /library/application support/apple/parentalcontrols/ to my network account so that I could view the files, however I am not sure that this was the correct way to view the files or not.



I have reviewed several articles about creating a rsa key for this and copying the public key to the remote machines. I am unclear where exactly to copy the .pub key and how to scp the events.data file using that publickey to either a folder on the server or to my own work station… Any insight would be greatly appreciated…

Mac Pro, Mac OS X (10.6.8), OSX Server 10.6.8

Posted on Aug 29, 2012 8:46 AM

Reply
3 replies

Aug 29, 2012 10:43 AM in response to Goetch

Ok, I think I have fixed the permissions issue I was having, instead of changing the owner of the file I just needed to change the file permissions to allow the group access, so I ran chmod -R 770 on /library/application\ support/apple/parentalcontrols/users so that the admin group can have full control of the files in that folder .....


I aam still unsure as to where to save the rsa public key for the cron job...

Aug 29, 2012 10:49 AM in response to Goetch

I chown on the "users" folder in /library/application support/apple/parentalcontrols/ to my network account so that I could view the files, however I am not sure that this was the correct way to view the files or not.


chowning the directory is almost certainly not the right way to go. Depending on how you changed it, you might prevent users from creating new event.data files, which kind of blows your entire plan.


In any case, your this sounds more like a question of how to copy the data, not a cron/scheduled task issue.


If you use scp then, yes, you're probably going to want to setup private keys so that the clients can transfer the data without human interaction, but that's the easy part.

If you have multiple machines copying data you need to consider where you're copying the data to - you can't just have them all copy the events.data file to the same place since it'll just overwrite any existing files and you'll lose your data. You need a mechanism that can handle multiple users's data (e.g. one events.data file per user) from multiple machines (e.g. 'joe' logging on from machine1 and machine2 in the same day).


Ultimately that leads to some fairly in-depth shell scripting techniques. Before you embark on that path you need to clearly identify your needs, and how you intend to deal with filename conflicts.


Note, also, that there are other alternatives to scp, especially if your client systems already mount a network share on the server - they might be able to make a simple file copy, but the same issues above still apply.

Aug 29, 2012 11:38 AM in response to Camelot

I didn't think chowning was the correct way to go, at the time it was all I could think of, but of course hindsight is always 20/20. I reverted my changes and then changed the permissions so that the admin group could read,write, execute,... Thinking about it more I should just give the admin group read permissions, that should be enough to access the files.


I clearly didn't think about multiple users on multiple machines but that is a reality. I am guesing I might be able to vary the filenames with date-machine-user, that should make them unique, although, I am not entirely clear if the events.data file archrives itself or keeps a running log from the start of time... I will try to do a little research on that...

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to Create a Cron Job to SCP events.data files to a Server Folder

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.