diff --git a/restic/.bin/restic_backup b/restic/.bin/restic_backup index 7752266..c7a7b4c 100755 --- a/restic/.bin/restic_backup +++ b/restic/.bin/restic_backup @@ -6,3 +6,6 @@ export RESTIC_PASSWORD="${RESTIC_PASSWORD}" info "Starting backup" restic -r $RESTIC_REPOSITORY unlock restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY backup $BACKUP_PATHS $BACKUP_EXCLUDES + +info "Forgetting snapshots" +restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY forget --keep-hourly $KEEP_HOURS --keep-daily $KEEP_DAYS --keep-weekly $KEEP_WEEKS --keep-monthly $KEEP_WEEKS --keep-yearly $KEEP_YEARS \ No newline at end of file diff --git a/restic/.bin/restic_common b/restic/.bin/restic_common index 0b7e7b2..a80bfee 100755 --- a/restic/.bin/restic_common +++ b/restic/.bin/restic_common @@ -40,7 +40,7 @@ ping -c 3 192.168.178.100 &> /dev/null if [[ $? > 0 ]]; then - ping -c 3 1.1.1.1 &> /dev/null + ping -c 3 10.0.1.3 &> /dev/null if [[ $? > 0 ]]; then info "Not connected." @@ -51,4 +51,4 @@ fi BACKUP_SERVER="192.168.178.100" echo "Done" -read_config +read_config \ No newline at end of file diff --git a/restic/.bin/restic_prune b/restic/.bin/restic_prune index 53ba722..39274f3 100755 --- a/restic/.bin/restic_prune +++ b/restic/.bin/restic_prune @@ -2,10 +2,5 @@ source $HOME/.bin/restic_common -info "Forgetting snapshots" -restic -r $RESTIC_REPOSITORY unlock -restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY forget --keep-hourly $KEEP_HOURS --keep-daily $KEEP_DAYS --keep-weekly $KEEP_WEEKS --keep-monthly $KEEP_WEEKS --keep-yearly $KEEP_YEARS - info "Pruning snapshots" -restic -r $RESTIC_REPOSITORY unlock -restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY prune +restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY prune \ No newline at end of file diff --git a/restic/.config/systemd/user/restic-backup.service b/restic/.config/systemd/user/restic-backup.service index 8c65abf..1df020e 100644 --- a/restic/.config/systemd/user/restic-backup.service +++ b/restic/.config/systemd/user/restic-backup.service @@ -1,5 +1,5 @@ [Unit] -Description=borg backup +Description=restic backup Before=restic-prune.service [Service] @@ -7,4 +7,4 @@ Type=oneshot ExecStart=%h/.bin/restic_backup [Install] -WantedBy=multi-user.target +WantedBy=multi-user.target \ No newline at end of file diff --git a/restic/.config/systemd/user/restic-prune.service b/restic/.config/systemd/user/restic-prune.service index ea3929b..211a44a 100644 --- a/restic/.config/systemd/user/restic-prune.service +++ b/restic/.config/systemd/user/restic-prune.service @@ -1,5 +1,5 @@ [Unit] -Description=prune borg snapshots +Description=restic prune snapshots After=restic-backup.service [Service] @@ -7,4 +7,4 @@ Type=oneshot ExecStart=%h/.bin/restic_prune [Install] -WantedBy=multi-user.target +WantedBy=multi-user.target \ No newline at end of file diff --git a/restic/.config/systemd/user/restic-prune.timer b/restic/.config/systemd/user/restic-prune.timer index e0a69cf..d77a753 100644 --- a/restic/.config/systemd/user/restic-prune.timer +++ b/restic/.config/systemd/user/restic-prune.timer @@ -1,10 +1,10 @@ [Unit] -Description=prune restic snapshots +Description=restic prune snapshots [Timer] Persistent=true -OnCalendar=daily +OnCalendar=weekly Unit=restic-prune.service [Install] -WantedBy=timers.target +WantedBy=timers.target \ No newline at end of file