12 Commits

Author SHA1 Message Date
Erik Westrup
7bc0e33779 Update CHANGELOG.md 2023-03-08 11:26:48 +01:00
Erik Westrup
86d841a72b Modified: CHANGELOG.md 2023-03-08 10:55:39 +01:00
Erik Westrup
4fba6a3f10 Fix comment 2023-03-08 10:54:31 +01:00
Ante de Baas
347322d9c9 pre_backup commands (#107)
* pre_backup list

* add $INSTALL_PREFIX

* make it executable

* remove pre_backup.txt

* fix quotes

Co-authored-by: Erik Westrup <erik.westrup@gmail.com>

---------

Co-authored-by: Erik Westrup <erik.westrup@gmail.com>
2023-03-08 10:53:20 +01:00
Matt
f5c50a18ad Update install.ps1 (#103)
Fixed typo that kept restic_check from running
2022-11-16 15:38:14 +01:00
Erik Westrup
eee3c4659b Update README.md
Fixes #100
2022-09-18 11:44:03 +02:00
Erik Westrup
ef58c46fde nm after service
Fixes #100
2022-09-18 11:43:09 +02:00
Erik Westrup
3aa88ebb45 nm after needed
Fixes #100
2022-09-18 11:42:22 +02:00
Erik Westrup
9e60df6caa Update README.md
Relates to #99
2022-08-16 21:47:56 +02:00
Erik Westrup
1b4d5ea24e Remove trailing space 2022-07-27 18:19:59 +02:00
Erik Westrup
b7f250f345 Modified: CHANGELOG.md 2022-07-27 18:19:21 +02:00
Mikhail
fc6bd5a0be Add support saving hourly snapshots (#98) 2022-07-27 18:19:05 +02:00
6 changed files with 13 additions and 2 deletions

View File

@@ -5,8 +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]
## [7.4.0] - 2023-03-08
### Added
- Support saving hourly snapshots. [#98](https://github.com/erikw/restic-automatic-backup-scheduler/pull/98)
- Support for pre backup script at /etc/restic/pre_backup.sh [107](https://github.com/erikw/restic-automatic-backup-scheduler/pull/107)
### Fixed
- Full path to `/bin/bash` in sytemd services. [#96](https://github.com/erikw/restic-automatic-backup-scheduler/issues/96)

View File

@@ -36,6 +36,8 @@ The scope for this is not to be a full-fledged super solution that solves all th
Nevertheless the project should work out of the box, be minimal but still open the doors for configuration and extensions by users.
To use a different storage backend than B2, you should only need to tweak a few settings variables in the backup profile as well as some restic arguments inside `restic_backup.sh`.
## Notes
* Tip: Navigate this document easily from the Section icon in the top left corner.
![README Sections](img/readme_sections.png)
@@ -496,6 +498,7 @@ For a laptop, it can make sense to not do heavy backups when your on a metered c
1. Edit `restic-backup@.service` and `restic-check@.service` to require the new service to be in success state:
```
Requires=nm-unmetered-connection.service
After=nm-unmetered-connection.service
```
1. Copy and paste the command below, it will install the following files and refresh systemd daemon:
1. Put this file in `/etc/systemd/system/`:

View File

@@ -14,6 +14,6 @@ $trigger = New-ScheduledTaskTrigger -Daily -At 7pm
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "restic_backup" -Description "Daily backup to B2 with restic."
# Install restic_check.sh
$action = New-ScheduledTaskAction -Execute "$(scoop prefix git)\git-bash.exe" -Argument '-l -c "source $INSTALL_PREFIX/etc/restic/default.env.sh && /INSTALL_PREFIX/bin/restic_check.sh"'
$action = New-ScheduledTaskAction -Execute "$(scoop prefix git)\git-bash.exe" -Argument '-l -c "source $INSTALL_PREFIX/etc/restic/default.env.sh && $INSTALL_PREFIX/bin/restic_check.sh"'
$trigger = New-ScheduledTaskTrigger -Weekly -WeeksInterval 4 -DaysOfWeek Sunday -At 8pm -RandomDelay 128
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "restic_check" -Description "Check B2 backups with restic."

View File

@@ -44,6 +44,9 @@ assert_envvars \
IFS=':' read -ra backup_paths <<< "$RESTIC_BACKUP_PATHS"
IFS=' ' read -ra extra_args <<< "$RESTIC_BACKUP_EXTRA_ARGS"
# If you need to run some commands before performing the backup; create this file, put them there and make the file executable.
PRE_SCRIPT="${INSTALL_PREFIX}/etc/restic/pre_backup.sh"
test -x "$PRE_SCRIPT" && "$PRE_SCRIPT"
# Set up exclude files: global + path-specific ones
# NOTE that restic will fail the backup if not all listed --exclude-files exist. Thus we should only list them if they are really all available.
@@ -93,7 +96,7 @@ restic forget \
--option b2.connections="$B2_CONNECTIONS" \
--prune \
--group-by "paths,tags" \
--keep-hourly "$RESTIC_RETENTION_HOURS" \
--keep-hourly "$RESTIC_RETENTION_HOURS" \
--keep-daily "$RESTIC_RETENTION_DAYS" \
--keep-weekly "$RESTIC_RETENTION_WEEKS" \
--keep-monthly "$RESTIC_RETENTION_MONTHS" \

View File

@@ -4,6 +4,7 @@ Description=Backup with restic to Backblaze B2
#OnFailure=status-email-user@%n.service
# Prevent backup on unmetered connection. Needs special setup. See README.md.
#Requires=nm-unmetered-connection.service
#After=nm-unmetered-connection.service
[Service]
Type=simple

View File

@@ -5,6 +5,7 @@ Description=Check restic backup Backblaze B2 for errors
Conflicts=restic-backup.service
# Prevent backup on unmetered connection. Needs special setup. See README.md.
#Requires=nm-unmetered-connection.service
#After=nm-unmetered-connection.service
[Service]
Type=simple