自动备份越狱iPhone DCIM照片目录

发布于 2024-11-14 22:41:11 字数 1207 浏览 2 评论 0原文

你好,我听说你可以将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

预谋 2024-11-21 22:41:11

我没有在 iPhone 上使用过 launchd,但在 Mac OS X 上,ProgramArguments 的第一个字符串需要是程序名称本身。尝试将该部分从: 更改

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

为:

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

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文