Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 4 of 4
  1. #1
    jax115 is offline Registered User
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Launchd and Lftp

    Hi,

    I am using ftp to sync an ftp server with a local folder. I have a shell script I am able to execute using the terminal. I am using Lingon to add a plist to the lauchd program so that the shell script runs hourly. The shell script ususes lftp to sync. But when launchd tries to execute the script I get an error from lftp "lftp: command not found". What am I missing? thanks

    Below is the plist I am using:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>Disabled</key>
    	<false/>
    	<key>KeepAlive</key>
    	<true/>
    	<key>Label</key>
    	<string>Torrent Sync</string>
    	<key>Program</key>
    	<string>lftp</string>
    	<key>ProgramArguments</key>
    	<array>
    		<string>/Users/harounsharif/Desktop/Downloads/synctorrents.sh</string>
    	</array>
    	<key>RunAtLoad</key>
    	<true/>
    	<key>StartInterval</key>
    	<integer>60</integer>
    	<key>WorkingDirectory</key>
    	<string>/Users/harounsharif/Desktop/Downloads</string>
    </dict>
    </plist>

  2. #2
    jax115 is offline Registered User
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Use cron instead?

    Maybe I could accomplish the same thing with Cron. I realize there are a multitude of cron tutorials out there but for some reason I do not seem to have a cron file, and the cron -e command only creates a temporary one. If I do create a crontab file how do I direct cron to it? I am on OSX 10.7.

    Any ideas greatly appreciated

  3. #3
    BjarneDM's Avatar
    BjarneDM is offline Registered User
    Join Date
    Oct 2005
    Location
    København ; Danmark ; Europa
    Posts
    218
    Thanks
    0
    Thanked 14 Times in 14 Posts
    Drop the following four items from the plist file:
    • Disabled - not necessary from 10.6
    • KeepAlive - not necessary in your circumstance
    • Program - you are using it incorrectly and it's not necessary due to you having specified the actual script in ProgramArguments
    • RunAtLoad - not necessary in your circumstance

    Change this :
    • Label : user.harounsharif.torrentsync

    Save the plist file as user.harounsharif.torrentsync.plist in the apporpriate place.

    You can find a description of the possible values in a launchd plist file here : launchd.plist(5) Mac OS X Manual Page

  4. #4
    BjarneDM's Avatar
    BjarneDM is offline Registered User
    Join Date
    Oct 2005
    Location
    København ; Danmark ; Europa
    Posts
    218
    Thanks
    0
    Thanked 14 Times in 14 Posts
    You don't have a cron file because Apple really want's to replace it with launchd jobs.

    There are at least 4 ways of scheduling jobs to run :
    1. launchd
    2. periodic
    3. cron
    4. at

    Apple is using the first 2 and in some circumstances I'm using cron too because it's much easier to re-schedule and edit cron jobs. Otherwise, I write launchd plist files for services or I add mantainance jobs to periodic .

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •