我的问题backupscript
似乎不适用于 OS launchd
X。
这是我想运行的脚本:
#
# backupscript
#
NOW=$(date +"%y%m%d-%H:%M:%S")
LOGFILE=/usr/local/server/log/$NOW
SOURCE=/
DESTINATION=remote@remote::/media/backup
INCLUDE_LIST=/usr/local/server/include-list
KEEP_TIME=40B
RDIFF_BACKUP=/usr/local/bin/rdiff-backup
$RDIFF_BACKUP --print-statistics -v5 --include-globbing-filelist $INCLUDE_LIST $SOURCE $DESTINATION > $LOGFILE
$RDIFF_BACKUP --remove-older-than $KEEP_TIME $DESTINATION
如您所见,它没有什么特别之处,并且在不使用launchd
.
但是,当我使用它运行它时,launchd
它不会... XML 文件如下所示:
<?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>Label</key>
<string>backup.plist</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>/usr/local/server/backup.sh</string>
</array>
<key>LowPriorityIO</key>
<true/>
<key>AbandonProcessGroup</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Hour</key>
<integer>10</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<dict>
<key>Hour</key>
<integer>14</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<dict>
<key>Hour</key>
<integer>18</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<dict>
<key>Hour</key>
<integer>22</integer>
<key>Minute</key>
<integer>54</integer>
</dict>
</array>
</dict>
</plist>
脚本正在运行,但没有对远程主机进行备份。backup.plist 位于 /Library/LaunchDeamons,因此它应该以 root 身份运行。
我不知道可能是什么问题,权限也应该没问题。这已经困扰我好几天了...
有什么建议么?