Routinely backup log file in OSX?

0

I need to routinely backup a log file on my OSX machine and either email it or FTP/SFTP the file to my server.

I know that a bash script can be written to accomplish the above task but how could I run this regularly, say on the hour or daily?

Also the machine is being used by another employee, would it possible for this to be run in the background as it is possible that they are in the middle of working and a terminal window popping up might be unproductive, especially on the hour.

Thanks.

Ashley

Posted 2011-06-08T06:30:51.010

Reputation: 163

Answers

2

Use launchd to invoke your script. This will not open Terminal.

For periodic launches, use StartInterval and StartCalendarInterval. man launchd.plist will show you how to do this.


Alternatively, you also have cron on OS X.

Daniel Beck

Posted 2011-06-08T06:30:51.010

Reputation: 98 421