9 Commits

Author SHA1 Message Date
Erik Westrup
0f3d39dfe1 Custom launchagent dir 2022-02-12 17:33:29 +01:00
Erik Westrup
f7c13f7290 Add homebrew formula
Fixes #73
2022-02-11 23:06:17 +01:00
Erik Westrup
c07f0ca027 Modified: CHANGELOG.md 2022-02-11 22:13:53 +01:00
Erik Westrup
a084830441 Modified: CHANGELOG.md 2022-02-11 22:13:41 +01:00
Erik Westrup
7d67142b6e Use correct profile in launchagent 2022-02-11 22:13:19 +01:00
Erik Westrup
b838ebcb1a Modified: CHANGELOG.md 2022-02-11 22:08:10 +01:00
Erik Westrup
8f118b6ddf Allow make to override etc dir 2022-02-11 22:07:26 +01:00
Erik Westrup
fc01b56e1e Modified: CHANGELOG.md 2022-02-11 21:47:34 +01:00
Erik Westrup
289016f8ea No need to write perm on scripts 2022-02-11 21:46:56 +01:00
4 changed files with 40 additions and 7 deletions

View File

@@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [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.

View File

@@ -12,7 +12,7 @@
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>source /usr/local/etc/restic/erikw.env.sh &amp;&amp; /usr/local/bin/restic_backup.sh >>$HOME/$LOG_OUT 2>>$HOME/$LOG_ERR</string>
<string>source /usr/local/etc/restic/default.env.sh &amp;&amp; /usr/local/bin/restic_backup.sh >>$HOME/$LOG_OUT 2>>$HOME/$LOG_ERR</string>
</array>
<key>EnvironmentVariables</key>
<dict>

View File

@@ -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 := $(PREFIX)
# Source directories.
DIR_SCRIPT = bin
DIR_CONF = etc/restic
@@ -82,17 +88,17 @@ 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_CRON = $(addprefix $(LAUNCHAGENTDIR)/, $(SRCS_CRON))
DEST_TARGS_LAUNCHAGENT = $(addprefix $(HOME)/, $(SRCS_LAUNCHAGENT))
INSTALLED_FILES = $(DEST_TARGS_SCRIPT) $(DEST_TARGS_CONF) \
@@ -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)/%

View File

@@ -6,6 +6,7 @@
[![Latest tag](https://img.shields.io/github/v/tag/erikw/restic-systemd-automatic-backup)](https://github.com/erikw/restic-systemd-automatic-backup/tags)
[![AUR version](https://img.shields.io/aur/version/restic-systemd-automatic-backup)](https://aur.archlinux.org/packages/restic-systemd-automatic-backup/)
[![AUR maintainer](https://img.shields.io/aur/maintainer/restic-systemd-automatic-backup?label=AUR%20maintainer)](https://aur.archlinux.org/packages/restic-systemd-automatic-backup/)
[![Homebrew Formula](https://img.shields.io/badge/homebrew-erikw%2Ftap-orange)](https://github.com/erikw/homebrew-tap)
[![Open issues](https://img.shields.io/github/issues/erikw/restic-systemd-automatic-backup)](https://github.com/erikw/restic-systemd-automatic-backup/issues)
[![Closed issues](https://img.shields.io/github/issues-closed/erikw/restic-systemd-automatic-backup?color=success)](https://github.com/erikw/restic-systemd-automatic-backup/issues?q=is%3Aissue+is%3Aclosed)
[![Closed PRs](https://img.shields.io/github/issues-pr-closed/erikw/restic-systemd-automatic-backup?color=success)](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).