Path working
This commit is contained in:
@@ -6,12 +6,22 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>Label</key>
|
<key>Label</key>
|
||||||
<string>com.github.erikw.restic-automatic-backup</string>
|
<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>
|
<key>ProgramArguments</key>
|
||||||
<array>
|
<array>
|
||||||
<string>/bin/bash</string>
|
<string>/bin/bash</string>
|
||||||
<string>-c</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>
|
</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>
|
<key>RunAtLoad</key>
|
||||||
<true/>
|
<true/>
|
||||||
<!-- Will schedule backup every day at 19:00 -->
|
<!-- Will schedule backup every day at 19:00 -->
|
||||||
@@ -24,15 +34,5 @@
|
|||||||
<integer>0</integer>
|
<integer>0</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</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>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -268,10 +268,21 @@ LaunchAgent is the modern service schedulerin in macOS that uses [Launchd](https
|
|||||||
```console
|
```console
|
||||||
$ PREFIX=/usr/local make install-launchagent
|
$ PREFIX=/usr/local make install-launchagent
|
||||||
$ vim ~/Library/LaunchAgents/com.github.erikw.restic-automatic-backup.plist # Edit schedule if needed.
|
$ 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 enable gui/$UID/com.github.erikw.restic-automatic-backup
|
||||||
$ launchctl kickstart -p 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
|
## Setup Cron
|
||||||
If you want to run an all-classic cron job instead, do like this:
|
If you want to run an all-classic cron job instead, do like this:
|
||||||
|
|||||||
Reference in New Issue
Block a user