iterate
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
<string>com.github.erikw.restic-automatic-backup</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/bin/sh</string>
|
||||
<string>/bin/bash</string>
|
||||
<string>-c</string>
|
||||
<string>. /usr/local/etc/restic/erikw.env.sh && /usr/local/bin/restic_backup.sh</string>
|
||||
<string>source /usr/local/etc/restic/erikw.env.sh && /usr/local/bin/restic_backup.sh</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
@@ -24,5 +24,15 @@
|
||||
<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>
|
||||
|
||||
8
Makefile
8
Makefile
@@ -74,6 +74,7 @@ DEST_DIR_CONF = $(PREFIX)/$(DIR_CONF)
|
||||
DEST_DIR_SYSTEMD = $(PREFIX)/$(DIR_SYSTEMD)
|
||||
DEST_DIR_CRON = $(PREFIX)/$(DIR_CRON)
|
||||
DEST_DIR_LAUNCHAGENT= $(HOME)/$(DIR_LAUNCHAGENT)
|
||||
DEST_DIR_MAC_LOG = $(HOME)/Library/Logs/restic
|
||||
|
||||
# Destination file targets.
|
||||
DEST_TARGS_SCRIPT = $(addprefix $(PREFIX)/, $(SRCS_SCRIPT))
|
||||
@@ -124,7 +125,8 @@ install-targets-script: $(DEST_TARGS_SCRIPT) $(BUILD_SRCS_SCRIPT)
|
||||
install-targets-conf: $(DEST_TARGS_CONF) $(BUILD_SRCS_CONF)
|
||||
install-targets-systemd: $(DEST_TARGS_SYSTEMD) $(BUILD_SRCS_SYSTEMD)
|
||||
install-targets-cron: $(DEST_TARGS_CRON) $(BUILD_SRCS_CRON)
|
||||
install-targets-launchagent: $(DEST_TARGS_LAUNCHAGENT) $(BUILD_SRCS_LAUNCHAGENT)
|
||||
install-targets-launchagent: $(DEST_TARGS_LAUNCHAGENT) \
|
||||
$(BUILD_SRCS_LAUNCHAGENT) $(DEST_DIR_MAC_LOG)
|
||||
|
||||
# Copies sources to build directory & replace "$INSTALL_PREFIX".
|
||||
$(BUILD_DIR)/% : %
|
||||
@@ -156,3 +158,7 @@ $(DEST_DIR_CRON)/%: $(BUILD_DIR_CRON)/%
|
||||
$(DEST_DIR_LAUNCHAGENT)/%: $(BUILD_DIR_LAUNCHAGENT)/%
|
||||
@${MKDIR_PARENTS} $@
|
||||
install -m 0444 $< $@
|
||||
|
||||
# Install destination mac log dir.
|
||||
$(DEST_DIR_MAC_LOG):
|
||||
mkdir -p $@
|
||||
|
||||
@@ -268,8 +268,8 @@ 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 load -w ~/Library/LaunchAgents/com.github.erikw.restic-automatic-backup.plist
|
||||
$ launchctl kickstart gui/501/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
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user