Commit 8022e8db authored by kaiyou's avatar kaiyou

Add the backup script

parent d931b93e
#!/usr/bin/env bash
set -e -o pipefail
source /srv/config/backup.config
export RESTIC_REPOSITORY RESTIC_PASSWORD AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
restic unlock &
wait $!
restic backup \
--verbose \
--one-file-system \
$BACKUP_EXCLUDES \
$BACKUP_PATHS &
wait $!
restic forget \
--verbose \
--prune \
--group-by "paths" \
--keep-daily $RETENTION_DAYS \
--keep-weekly $RETENTION_WEEKS \
--keep-monthly $RETENTION_MONTHS \
--keep-yearly $RETENTION_YEARS &
wait $!
echo "Backup & cleaning is done."
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment