install instructions

This commit is contained in:
Erik Westrup
2022-02-09 15:56:37 +01:00
parent c4429681d8
commit 991476715a
2 changed files with 21 additions and 15 deletions
+1
View File
@@ -1,3 +1,4 @@
# TODO add install for launchagent completely, and unisntall target using bootstrap?
#### Notes #################################################################### #### Notes ####################################################################
# This build process is done in three stages (out-of-source build): # This build process is done in three stages (out-of-source build):
# 1. copy source files to the local build directory. # 1. copy source files to the local build directory.
+20 -15
View File
@@ -262,23 +262,28 @@ straightforward (it needs to run with sudo to read environment). Just run:
| `resticw mount /mnt/restic` | Mount your remote repository | | `resticw mount /mnt/restic` | Mount your remote repository |
## Setup macOS LaunchAgent ## Setup macOS LaunchAgent
LaunchAgent is the modern service schedulerin in macOS that uses [Launchd](https://www.launchd.info/). LaunchAgent is the modern service scheduler in in macOS that uses [Launchd](https://www.launchd.info/).
[Launchd](https://www.launchd.info/) is the modern built-in service scheduler in macOS. It has support for running services as root (Daemon) or as a normal user (Agent). Here we we set up an Lauch Agent to be run as your normal user for starting regular backups. [Launchd](https://www.launchd.info/) is the modern built-in service scheduler in macOS. It has support for running services as root (Daemon) or as a normal user (Agent). Here we we set up an LauchAgent to be run as your normal user for starting regular backups.
```console 1. In general, follow the same setup as in (#setup-linux-systemd) except taht
$ PREFIX=/usr/local make install-launchagent * use `make install-launchagent` instead of `make install-systemd`
$ vim ~/Library/LaunchAgents/com.github.erikw.restic-automatic-backup.plist # Edit schedule if needed. * Install everything to `/usr/local` and run restic as your own use, not root
$ launchctl bootstrap gui/$UID ~/Library/LaunchAgents/com.github.erikw.restic-automatic-backup.plist * Thus, install with
$ launchctl enable gui/$UID/com.github.erikw.restic-automatic-backup ```console
$ launchctl kickstart -p gui/$UID/com.github.erikw.restic-automatic-backup $ PREFIX=/usr/local make install-launchagent
``` ```
1. After installation with `make` , edit the installed launchagent if you want to change the default schedule or profile used
```console
$ vim ~/Library/LaunchAgents/com.github.erikw.restic-automatic-backup.plist
```
1. Now install, enable and kickstart 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
```
Debug with Use the `disable` command to temporarily pause the agent, or `bootout` to uninstall it.
```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 disable gui/$UID/com.github.erikw.restic-automatic-backup
$ launchctl bootout gui/$UID/com.github.erikw.restic-automatic-backup $ launchctl bootout gui/$UID/com.github.erikw.restic-automatic-backup