Path working
This commit is contained in:
@@ -6,12 +6,22 @@
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.github.erikw.restic-automatic-backup</string>
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
<string>/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
|
||||
</dict>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/bin/bash</string>
|
||||
<string>-c</string>
|
||||
<string>source /usr/local/etc/restic/erikw.env.sh && /usr/local/bin/restic_backup.sh</string>
|
||||
<string>export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin && source /usr/local/etc/restic/erikw.env.sh && PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin /usr/local/bin/restic_backup.sh</string>
|
||||
</array>
|
||||
<!-- how use $HOME? -->
|
||||
<key>StandardOutPath</key>
|
||||
<string>/Users/erikw/Library/Logs/restic/restic_stdout.log</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/Users/erikw/Library/Logs/restic/restic_stderr.log</string>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<!-- Will schedule backup every day at 19:00 -->
|
||||
@@ -24,15 +34,5 @@
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</array>
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
<string>/usr/local/bin:/usr/bin:/bin</string>
|
||||
</dict>
|
||||
<!-- how use $HOME? -->
|
||||
<key>StandardOutPath</key>
|
||||
<string>/Users/erikw/Library/Logs/restic/restic_stdout.txt</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/Users/erikw/Library/Logs/restic/restic_stderr.txt</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
11
README.md
11
README.md
@@ -268,10 +268,21 @@ LaunchAgent is the modern service schedulerin in macOS that uses [Launchd](https
|
||||
```console
|
||||
$ PREFIX=/usr/local make install-launchagent
|
||||
$ vim ~/Library/LaunchAgents/com.github.erikw.restic-automatic-backup.plist # Edit schedule if needed.
|
||||
$ launchctl bootstrap gui/$UID ~/Library/LaunchAgents/com.github.erikw.restic-automatic-backup.plist
|
||||
$ launchctl enable gui/$UID/com.github.erikw.restic-automatic-backup
|
||||
$ launchctl kickstart -p gui/$UID/com.github.erikw.restic-automatic-backup
|
||||
```
|
||||
|
||||
Debug with
|
||||
```console
|
||||
$ sudo launchctl debug gui/$UID/com.github.erikw.restic-automatic-backup --stdout --stderr
|
||||
```
|
||||
|
||||
TODO how disable?
|
||||
```
|
||||
$ launchctl disable gui/$UID/com.github.erikw.restic-automatic-backup
|
||||
$ launchctl bootout gui/$UID/com.github.erikw.restic-automatic-backup
|
||||
```
|
||||
|
||||
## Setup Cron
|
||||
If you want to run an all-classic cron job instead, do like this:
|
||||
|
||||
Reference in New Issue
Block a user