Compare commits
6 Commits
v7.3.4
...
mikhailbot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e540ef5e3 | ||
|
|
2759964b13 | ||
|
|
9fa01a10f7 | ||
|
|
811a5c3c8c | ||
|
|
49cc054eeb | ||
|
|
a35a9977f3 |
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- Support saving hourly snapshots. [#98](https://github.com/erikw/restic-automatic-backup-scheduler/pull/98)
|
||||
|
||||
### Fixed
|
||||
- Full path to `/bin/bash` in sytemd services. [#96](https://github.com/erikw/restic-automatic-backup-scheduler/issues/96)
|
||||
|
||||
## [7.3.4] - 2022-04-29
|
||||
### Fixed
|
||||
|
||||
15
README.md
15
README.md
@@ -14,6 +14,7 @@
|
||||
[](https://github.com/erikw/restic-automatic-backup-scheduler/pulls?q=is%3Apr+is%3Aclosed)
|
||||
[](LICENSE)
|
||||
[](https://github.com/Netflix/osstracker)
|
||||
[](#)
|
||||
<br>
|
||||
|
||||
[](https://github.com/erikw/restic-automatic-backup-scheduler/graphs/contributors) including these top contributors:
|
||||
@@ -109,9 +110,9 @@ Many Linux distributions nowadays use [Systemd](https://en.wikipedia.org/wiki/Sy
|
||||
## Setup macOS LaunchAgent
|
||||
<img height="64" width="64" src="https://unpkg.com/simple-icons@v6/icons/apple.svg" />
|
||||
|
||||
☝ **Note** The macOS setup here will assume an installation to `/usr/local`, as [custom](https://docs.brew.sh/FAQ#why-does-homebrew-say-sudo-is-bad) with Homebrew installations.
|
||||
☝ **Note** The macOS setup here will assume a Homebrew installation to the [recommended default location](https://docs.brew.sh/FAQ#why-should-i-install-homebrew-in-the-default-location). This is [`$HOMEBREW_PREFIX` (`brew --prefix`)](https://docs.brew.sh/Formula-Cookbook#variables-for-directory-locations) , which is `/usr/local` on Intel Macs and `/opt/homebrew` on [Apple Silicon](https://docs.brew.sh/FAQ#why-is-the-default-installation-prefix-opthomebrew-on-apple-silicon).
|
||||
|
||||
[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.
|
||||
[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 a LaunchAgent to be run as your normal user for starting regular backups.
|
||||
|
||||
**TL;DR setup**
|
||||
1. [Create](#1-create-backblaze-b2-account-bucket-and-keys) B2 bucket + credentials
|
||||
@@ -122,13 +123,13 @@ Many Linux distributions nowadays use [Systemd](https://en.wikipedia.org/wiki/Sy
|
||||
```
|
||||
* Using `make`:
|
||||
```console
|
||||
$ make PREFIX=/usr/local install-launchagent
|
||||
$ make PREFIX=$(brew --prefix) install-launchagent
|
||||
```
|
||||
1. Fill out [configuration values](#2-configure-b2-credentials-locally) in `/usr/local/etc/restic`.
|
||||
1. Fill out [configuration values](#2-configure-b2-credentials-locally) in `$(brew --prefix)/etc/restic`.
|
||||
1. [Initialize](#3-initialize-remote-repo) the remote repo.
|
||||
Source the profile to make all needed configuration available to `restic(1)`. All commands after this assumes the profile is sourced in the current shell.
|
||||
```console
|
||||
$ source /usr/local/etc/restic/default.env.sh
|
||||
$ source $(brew --prefix)/etc/restic/default.env.sh
|
||||
$ restic init
|
||||
```
|
||||
1. Configure [how often](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/ScheduledJobs.html#//apple_ref/doc/uid/10000172i-CH1-SW1) backups should be done. If needed, edit `OnCalendar` in
|
||||
@@ -433,8 +434,8 @@ To have different backup jobs having e.g. different buckets, backup path of sche
|
||||
To create a different backup and use you can do:
|
||||
```console
|
||||
# cp /etc/restic/default.env.sh /etc/restic/other.env.sh
|
||||
# vim /etc/restic/default.other.sh # Set backup path, bucket etc.
|
||||
# source /etc/restic/default.other.sh
|
||||
# vim /etc/restic/other.env.sh # Set backup path, bucket etc.
|
||||
# source /etc/restic/other.env.sh
|
||||
# restic_backup.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ restic forget \
|
||||
--option b2.connections="$B2_CONNECTIONS" \
|
||||
--prune \
|
||||
--group-by "paths,tags" \
|
||||
--keep-hourly "$RESTIC_RETENTION_HOURS" \
|
||||
--keep-daily "$RESTIC_RETENTION_DAYS" \
|
||||
--keep-weekly "$RESTIC_RETENTION_WEEKS" \
|
||||
--keep-monthly "$RESTIC_RETENTION_MONTHS" \
|
||||
|
||||
@@ -32,6 +32,7 @@ export RESTIC_BACKUP_TAG=systemd.timer
|
||||
|
||||
# Retention policy - How many backups to keep.
|
||||
# See https://restic.readthedocs.io/en/stable/060_forget.html?highlight=month#removing-snapshots-according-to-a-policy
|
||||
export RESTIC_RETENTION_HOURS=1
|
||||
export RESTIC_RETENTION_DAYS=14
|
||||
export RESTIC_RETENTION_WEEKS=16
|
||||
export RESTIC_RETENTION_MONTHS=18
|
||||
|
||||
@@ -13,4 +13,4 @@ Environment="HOME=/root"
|
||||
# pipefail: so that redirecting stderr from the script to systemd-cat does not hide the failed command from OnFailure above.
|
||||
# Random sleep (in seconds): in the case of multiple backup profiles. Many restic instances started at the same time could case high load or network bandwith usage.
|
||||
# `systemd-cat` allows showing the restic output to the systemd journal
|
||||
ExecStart=bash -c 'set -o pipefail; ps cax | grep -q restic && sleep $(shuf -i 0-300 -n 1); source $INSTALL_PREFIX/etc/restic/%I.env.sh && $INSTALL_PREFIX/bin/restic_backup.sh 2>&1 | systemd-cat'
|
||||
ExecStart=/bin/bash -c 'set -o pipefail; ps cax | grep -q restic && sleep $(shuf -i 0-300 -n 1); source $INSTALL_PREFIX/etc/restic/%I.env.sh && $INSTALL_PREFIX/bin/restic_backup.sh 2>&1 | systemd-cat'
|
||||
|
||||
@@ -11,4 +11,4 @@ Type=simple
|
||||
Nice=10
|
||||
# pipefail: so that redirecting stderr from the script to systemd-cat does not hide the failed command from OnFailure above.
|
||||
# `systemd-cat`: allows showing the restic output to the systemd journal
|
||||
ExecStart=bash -c 'set -o pipefail; source $INSTALL_PREFIX/etc/restic/%I.env.sh && $INSTALL_PREFIX/bin/restic_check.sh 2>&1 | systemd-cat'
|
||||
ExecStart=/bin/bash -c 'set -o pipefail; source $INSTALL_PREFIX/etc/restic/%I.env.sh && $INSTALL_PREFIX/bin/restic_check.sh 2>&1 | systemd-cat'
|
||||
|
||||
Reference in New Issue
Block a user