Solved

Using Launchd to run backup.sh script

Posted on 2008-11-02
9
935 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Shell Mail is not working 5 124
Fetching data from Multiple Linux Server using Shell Scripting 55 180
app store blank on mac 3 55
How to know the backup date of a restored DB? 4 53
The purpose of this Apple-hardware based article is to provide helpful information about an important component required of all Apple portable notebooks (Apple does not call them "Laptops" because they are too hot to sit on your lap), but is not o…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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