Rename launchagent for consistency

This commit is contained in:
Erik Westrup
2022-02-13 17:50:10 +01:00
parent cacfe58269
commit bb40afa67a
3 changed files with 7 additions and 7 deletions

View File

@@ -6,7 +6,7 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.erikw.restic-automatic-backup</string>
<string>com.github.erikw.restic-automatic-backup-scheduler</string>
<key>ProgramArguments</key>
<!-- exec in subshell to 1) source *.env.sh 2) expand $HOME to logpath (ref. https://apple.stackexchange.com/a/365880/197493) -->
<array>

View File

@@ -52,7 +52,7 @@ MKDIR_PARENTS=sh -c '\
# LaunchAgent names.
UID := $(shell id -u)
LAUNCHAGENT = com.github.erikw.restic-automatic-backup
LAUNCHAGENT = com.github.erikw.restic-automatic-backup-scheduler
LAUNCHAGENT_TARGET = gui/$(UID)/$(LAUNCHAGENT)
# What to substitute $INSTALL_PREFIX in sources to.

View File

@@ -295,16 +295,16 @@ $ brew services stop restic-automatic-backup-scheduler
```
1. Now install, enable and start the first run!
```console
$ 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
$ launchctl bootstrap gui/$UID ~/Library/LaunchAgents/com.github.erikw.restic-automatic-backup-scheduler.plist
$ launchctl enable gui/$UID/com.github.erikw.restic-automatic-backup-scheduler
$ launchctl kickstart -p gui/$UID/com.github.erikw.restic-automatic-backup-scheduler
```
As a convenience, a shortcut for the above commands are `$ make activate-launchagent`.
Use the `disable` command to temporarily pause the agent, or `bootout` to uninstall it.
```
$ launchctl disable gui/$UID/com.github.erikw.restic-automatic-backup
$ launchctl bootout gui/$UID/com.github.erikw.restic-automatic-backup
$ launchctl disable gui/$UID/com.github.erikw.restic-automatic-backup-scheduler
$ launchctl bootout gui/$UID/com.github.erikw.restic-automatic-backup-scheduler
```
If you updated the `.plist` file, you need to issue the `bootout` followed by `bootrstrap` and `enable` sub-commands of `launchctl`. This will guarantee that the file is properly reloaded.