Solved

Using Launchd to run backup.sh script

Posted on 2008-11-02
9
928 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Apple iTunes - Move from PC to PC First login to your old PC 1. Click on File. 2. Then click Library. 3. Now open the Export Library. 4. Save the .xml file to your desktop. This file will hold all of the information about your playl…
Does your iMac really need a hardware upgrade? Will upgrading RAM speed-up your computer? If yes, then how can you proceed? Upgrading RAM in your iMac is not as simple as it may seem. This article will help you in getting and installing right RA…
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now