Advertisement

11.02.2008 at 02:58AM PST, ID: 23868594 | Points: 500
[x]
Attachment Details

Using Launchd to run backup.sh script

Tags:

Apple, OS X 10.4/10.5, Help with launchd

I have a remote backup solution setup on client machine OSX 10.4.
It has an in built scheduler which should run the jobs every 1 hour but when the users put the macbook to sleep or shut the lid, the scheduler gets confused when the lid is re-open.

I need a way of either restarting the service when the user logs back in or run the backupset.sh file every hour rather than using the in build sheduler.

I can successfully run this code in terminal "sudo SystemStarter restart CeruleanDVM". How would I run this using launchd?

Else I can this this script by first browsing to the applications directory and running the script. e.g CD /Applications/"Cerulean DataVault Manager"/bin and then running "sh RunBackupset.sh". How would i implement this using launchd.
I made an attempt to use lingon to generate the script but it errors with file or directory not found.

Please advise
Top Expert: Tintin
Expert Since: 11/13/2002
Accepted Solutions: 3706
Tintin has been an Expert for 6 years1 month, during which he has posted 13256 comments and answered 3706 questions. Tintin is just one of 365 experts in the Shell Scripting Zone.
 
 
20081119-EE-VQP-47 - Hierarchy / EE_QW_2_20070628