Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I heard that you can write cron job into plist and put it to JB iPhone /Library/LaunchDaemons folder in plist format

I would like to backup the photo folder every 300 seconds, so I put a com.backup.plist like this into /Library/LaunchDaemons folder

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">






I have created a folder of /private/var/backup with access right of 777 mobile:mobile

I rebooted the iPhone, however, the script just doesn't work

Does the failure refer to the "cp" command access right? or should I change the /private/var/backup folder access right to something else?

btw I'm running iOS 4.3.3 Jailbreak iPhone 4

Many thanks for reading

share|improve this question

migrated from Jun 10 '11 at 5:49

This question came from our site for computer enthusiasts and power users.

Do you get any error messages in the log files? – Kerri Shotts Jun 14 '11 at 3:35
where will the log file of launchdaemons be located? – Unreality Jun 16 '11 at 6:26
up vote 0 down vote accepted

From the man lanuchctl

Note that per-user configuration files (LaunchAgents) must be owned by the user loading them. All system-wide daemons (LaunchDaemons) must be owned by root. Configuration files must not be group- or world-writable. These restrictions are in place for security reasons, as allowing writability to a launchd configuration file allows one to specify which executable will be launched.


chown root  /Library/LaunchDaemons/your.plist 
chgrp wheel /Library/LaunchDaemons/your.plist 
chmod 644   /Library/LaunchDaemons/your.plist

and after these:

launchctl load /Library/LaunchDaemons/your.plist
share|improve this answer

According to Wikipedia's article on cp:

To copy a directory to a directory (-r or -R must be used)

So try adding <string>-r</string> to the list of arguments. Reboot your device and after 5 minutes (300 seconds) check if it worked.


share|improve this answer
since running code cp -u /private/var/mobile/Media/DCIM/100APPLE/*.* /private/var/backup code directly in shell has no problem copying the files, so I believe the problem isn't about the argument of cp – Unreality Jun 20 '11 at 8:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.