Solved

Using Launchd to run backup.sh script

Posted on 2008-11-02
9
930 Views
Last Modified: 2013-12-21
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
0
Comment
Question by:M4NNY
  • 4
  • 3
9 Comments
 
LVL 1

Expert Comment

by:Southron
ID: 22863994
For ease of configuration, I recommend using the free and open source graphical tool called Lingon available from the following download site.

<http://www.macupdate.com/info.php/id/19879/lingon>

The current version is for Mac OS X 10.5, but that page also has a link to download the previous version which works with Tiger. The home site for this project is as follows.

<http://tuppis.com/lingon/>

The source code is available from the sourceforge site.

<http://sourceforge.net/projects/lingon/>

Please let me know if this was of help.


0
 

Author Comment

by:M4NNY
ID: 22868940
I have looked into Lingon. The problem i was facing was when i generated the plist file using Lingon, it could not run because it came back with file or directory not found. My guess is that it does not like the spaces between Cerulean DataVault Manager, even though the full path was put under quotations or it does not like the way the script is executed.

My script resides in the application directory as show below:
/Applications/Cerulean DataVault Manager/bin/RunBackupset.sh

Hope the information is more clearer
0
 
LVL 1

Expert Comment

by:Southron
ID: 22869190
Did you try the alternative of escaping the spaces in the path by using backslashes?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:M4NNY
ID: 22920984
Tried that too but still receiving the same issue.

Switched over to scheduling jobs using Cronnix but there i received a similar.

Not sure if this issue is related to the OS or the script it is trying to run
0
 
LVL 1

Expert Comment

by:Southron
ID: 22924104
If you're able to get the script to run in other ways as you mentioned (using SystemStarter and also by browsing to the directory and running it from there) then it seems like the script itself is fine. I'm guessing that the problem must be specific to the configuration for launchd to use the script.  

What error did you receive when trying to use Cronnix? This does seem more like a script that should be run as a cron job, anyway.
0
 

Author Comment

by:M4NNY
ID: 22967716
When running the script using both the launchd and cronnix, the error was file or folder not found.
0
 

Author Comment

by:M4NNY
ID: 23647679
Please close

Found an alternative solution to my problem
0
 

Accepted Solution

by:
ee_auto earned 0 total points
ID: 25221226
Question PAQ'd, 500 points refunded, and stored in the solution database.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Power shell script that will collect scheduled tasks and IIS web sites on a server 6 63
iPhone 7 64GB 5 129
Apple watch forgot password 2 54
Charging Macbook Pro 8 64
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question