开发者

Automatically backup JailBreak iPhone DCIM photo directory

开发者 https://www.devze.com 2023-03-11 18:49 出处:网络
Hi I heard that you can write cron job into plist and put it to JB iPhone /Library/LaunchDaemons folder in plist format

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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>KeepAlive</key>
    <true/>

    <key>Label</key>
    <string>com.backup</string>

    <key>Program</key>
    <string>/bin/cp</string>

    <key>ProgramArguments</key>开发者_如何学运维;
    <array>
        <string>-u</string>
        <string>/private/var/mobile/Media/DCIM/100APPLE/*.*</string>
        <string>/private/var/backup</string>
    </array>

    <key>StartInterval</key>
    <integer>300</integer>

</dict>
</plist>

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


I've not used launchd on an iPhone, but on Mac OS X, the first string to ProgramArguments needs to be the program name itself. Try changing that section from:

<key>ProgramArguments</key>
<array>
    <string>-u</string>
    <string>/private/var/mobile/Media/DCIM/100APPLE/*.*</string>
    <string>/private/var/backup</string>
</array>

To:

<key>ProgramArguments</key>
<array>
    <string>cp</string>
    <string>-u</string>
    <string>/private/var/mobile/Media/DCIM/100APPLE/*.*</string>
    <string>/private/var/backup</string>
</array>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号