自动备份越狱iPhone DCIM照片目录
你好,我听说你可以将 cron 作业写入 plist 并将其以 plist 格式放入 JB iPhone /Library/LaunchDaemons 文件夹中
我想每 300 秒备份一次照片文件夹,所以我将这样的 com.backup.plist 放入 / Library/LaunchDaemons 文件夹
<?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>
我创建了一个 /private/var/backup 文件夹,其访问权限为 777 mobile:mobile
我重新启动了 iPhone,但是,该脚本不起作用
失败是否与“cp”命令访问权限有关? 或者我应该将 /private/var/backup 文件夹访问权限更改为其他内容?
顺便说一句,我正在运行 iOS 4.3.3 越狱 iPhone 4
非常感谢您的阅读
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有在 iPhone 上使用过 launchd,但在 Mac OS X 上,ProgramArguments 的第一个字符串需要是程序名称本身。尝试将该部分从: 更改
为:
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:
To: