Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
399e7cd4ce | ||
|
|
0f3d39dfe1 | ||
|
|
f7c13f7290 | ||
|
|
c07f0ca027 | ||
|
|
a084830441 | ||
|
|
7d67142b6e | ||
|
|
b838ebcb1a | ||
|
|
8f118b6ddf | ||
|
|
fc01b56e1e | ||
|
|
289016f8ea |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -6,6 +6,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [5.3.1] - 2022-02-12
|
||||
### Fixed
|
||||
- Launchagentdir make macro
|
||||
|
||||
## [5.3.0] - 2022-02-12
|
||||
### Added
|
||||
- Allow custom launchagent dir, used by Homebrew.
|
||||
|
||||
## [5.2.1] - 2022-02-11
|
||||
### Added
|
||||
- Homebrew Formula at [erikw/homebrew-tap](https://github.com/erikw/homebrew-tap). You can now install with `$ brew install erikw/tap/restic-automatic-backup-scheduler`!
|
||||
|
||||
### Fixed
|
||||
- Use default profile in LaunchAgent.
|
||||
|
||||
## [5.2.0] - 2022-02-11
|
||||
### Added
|
||||
- Make option to override destination dir for configuration files. Needed for Homebrew.
|
||||
|
||||
### Changed
|
||||
- Write permissions on installed scripts removed (0755 -> 0555). Homebrew was complaining.
|
||||
|
||||
## [5.1.0] - 2022-02-11
|
||||
### Added
|
||||
- macos LaunchAgent support. Install with `make install-launchagent` and activate with `make activate-launchagent`. See [README.md](README.md) for details.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<array>
|
||||
<string>/bin/bash</string>
|
||||
<string>-c</string>
|
||||
<string>source /usr/local/etc/restic/erikw.env.sh && /usr/local/bin/restic_backup.sh >>$HOME/$LOG_OUT 2>>$HOME/$LOG_ERR</string>
|
||||
<string>source /usr/local/etc/restic/default.env.sh && /usr/local/bin/restic_backup.sh >>$HOME/$LOG_OUT 2>>$HOME/$LOG_ERR</string>
|
||||
</array>
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
|
||||
16
Makefile
16
Makefile
@@ -50,6 +50,12 @@ LAUNCHAGENT_TARGET = gui/$(UID)/$(LAUNCHAGENT)
|
||||
# package in a separate build directory (PREFIX).
|
||||
INSTALL_PREFIX := $(PREFIX)
|
||||
|
||||
# Where to install persistent configuration files. Used by Homebrew.
|
||||
SYSCONFDIR := $(PREFIX)
|
||||
|
||||
# Where to install LaunchAgent. Used by Homebrew.
|
||||
LAUNCHAGENTDIR := $(HOME)
|
||||
|
||||
# Source directories.
|
||||
DIR_SCRIPT = bin
|
||||
DIR_CONF = etc/restic
|
||||
@@ -82,18 +88,18 @@ BUILD_SRCS_LAUNCHAGENT = $(addprefix $(BUILD_DIR)/, $(SRCS_LAUNCHAGENT))
|
||||
|
||||
# Destination directories
|
||||
DEST_DIR_SCRIPT = $(PREFIX)/$(DIR_SCRIPT)
|
||||
DEST_DIR_CONF = $(PREFIX)/$(DIR_CONF)
|
||||
DEST_DIR_CONF = $(SYSCONFDIR)/$(DIR_CONF)
|
||||
DEST_DIR_SYSTEMD = $(PREFIX)/$(DIR_SYSTEMD)
|
||||
DEST_DIR_CRON = $(PREFIX)/$(DIR_CRON)
|
||||
DEST_DIR_LAUNCHAGENT= $(HOME)/$(DIR_LAUNCHAGENT)
|
||||
DEST_DIR_LAUNCHAGENT= $(LAUNCHAGENTDIR)/$(DIR_LAUNCHAGENT)
|
||||
DEST_DIR_MAC_LOG = $(HOME)/Library/Logs/restic
|
||||
|
||||
# Destination file targets.
|
||||
DEST_TARGS_SCRIPT = $(addprefix $(PREFIX)/, $(SRCS_SCRIPT))
|
||||
DEST_TARGS_CONF = $(addprefix $(PREFIX)/, $(SRCS_CONF))
|
||||
DEST_TARGS_CONF = $(addprefix $(SYSCONFDIR)/, $(SRCS_CONF))
|
||||
DEST_TARGS_SYSTEMD = $(addprefix $(PREFIX)/, $(SRCS_SYSTEMD))
|
||||
DEST_TARGS_CRON = $(addprefix $(PREFIX)/, $(SRCS_CRON))
|
||||
DEST_TARGS_LAUNCHAGENT = $(addprefix $(HOME)/, $(SRCS_LAUNCHAGENT))
|
||||
DEST_TARGS_LAUNCHAGENT = $(addprefix $(LAUNCHAGENTDIR)/, $(SRCS_LAUNCHAGENT))
|
||||
|
||||
INSTALLED_FILES = $(DEST_TARGS_SCRIPT) $(DEST_TARGS_CONF) \
|
||||
$(DEST_TARGS_SYSTEMD) $(DEST_TARGS_CRON) \
|
||||
@@ -149,7 +155,7 @@ $(BUILD_DIR)/% : %
|
||||
# Install destination script files.
|
||||
$(DEST_DIR_SCRIPT)/%: $(BUILD_DIR_SCRIPT)/%
|
||||
@${MKDIR_PARENTS} $@
|
||||
install -m 0755 $< $@
|
||||
install -m 0555 $< $@
|
||||
|
||||
# Install destination conf files. Additionally backup existing files.
|
||||
$(DEST_DIR_CONF)/%: $(BUILD_DIR_CONF)/%
|
||||
|
||||
11
README.md
11
README.md
@@ -6,6 +6,7 @@
|
||||
[](https://github.com/erikw/restic-systemd-automatic-backup/tags)
|
||||
[](https://aur.archlinux.org/packages/restic-systemd-automatic-backup/)
|
||||
[](https://aur.archlinux.org/packages/restic-systemd-automatic-backup/)
|
||||
[](https://github.com/erikw/homebrew-tap)
|
||||
[](https://github.com/erikw/restic-systemd-automatic-backup/issues)
|
||||
[](https://github.com/erikw/restic-systemd-automatic-backup/issues?q=is%3Aissue+is%3Aclosed)
|
||||
[](https://github.com/erikw/restic-systemd-automatic-backup/pulls?q=is%3Apr+is%3Aclosed)
|
||||
@@ -265,6 +266,13 @@ straightforward (it needs to run with sudo to read environment). Just run:
|
||||
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 set up an LauchAgent to be run as your normal user for starting regular backups.
|
||||
|
||||
### Homebrew
|
||||
With Homebrew you can easily install this project from the [erikw/homebrew-tap](https://github.com/erikw/homebrew-tap):
|
||||
```console
|
||||
$ brew install erikw/tap/restic-automatic-backup-scheduler
|
||||
```
|
||||
|
||||
### Manual
|
||||
1. In general, follow the same setup as in (#setup-linux-systemd) except for:
|
||||
* use `make install-launchagent` instead of `make install-systemd`
|
||||
* install everything to `/usr/local` and run restic as your own user, not root
|
||||
@@ -331,4 +339,5 @@ To make a new release:
|
||||
$ git tag vX.Y.Z
|
||||
$ git push && git push --tags
|
||||
```
|
||||
1. Test and update the AUR [PKGBUILD](https://aur.archlinux.org/packages/restic-systemd-automatic-backup/) if needed.
|
||||
1. Update version in the AUR [PKGBUILD](https://aur.archlinux.org/packages/restic-systemd-automatic-backup/).
|
||||
1. Update version in the Homebrew [Formula](https://github.com/erikw/homebrew-tap/blob/main/Formula/restic-automatic-backup-scheduler.rb).
|
||||
|
||||
Reference in New Issue
Block a user