The startup file is started manually, but not automatically.

I wrote a plist file and put it in / Library / LaunchDaemons

 <?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>com.dotcafe.DCDMySQLBackup</string>
 <key>ProgramArguments</key>
 <array>
  <string>/Users/robdando/Webserverbackup/grab.sh</string>
 </array>
 <key>StartInterval</key>
 <integer>900</integer>
</dict>
</plist>

I now have a script file for working with the terminal manually, but I can not get it to run every 15 minutes as I need, the script it calls the logs on the ftp server and pulls out a mysql database backup.

Greetings in advance.

+3
source share
2 answers

Have you uploaded the task to the correct one launchd? Based on where you placed the file, it looks like you should be doing sudo launchctl load /Library/LaunchDaemons/com.dotcafe.DCDMySQLBackup.plist. Subsequently, can you sudo launchctl start com.dotcafe.DCDMySQLBackup?

launchd , , , , launchctl start . , , cron.

+2

Program, . , grab.sh .

, , UserName. , .bash_profile , , . (, grab.sh .) script , .bash_profile, grab.sh.

-1

Source: https://habr.com/ru/post/1779005/


All Articles