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.

link|improve this question
feedback

1 Answer

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.