Commit cdec6d11 authored by kaiyou's avatar kaiyou

Backup every path individually

parent 61234071
......@@ -5,21 +5,13 @@ set -e -o pipefail
source /srv/config/backup.config
export RESTIC_REPOSITORY RESTIC_PASSWORD AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
for PATH in ${*:-$(find $BACKUP_PATHS -maxdepth 1 -mindepth 1 -type d)}; do
restic backup \
--cache-dir $CACHE_DIR \
--one-file-system \
--exclude-if-present .nobackup \
${*:-$(find $BACKUP_PATHS -maxdepth 1 -mindepth 1 -type d)} &
$PATH &
wait $!
done
restic forget \
--group-by "paths" \
--cache-dir $CACHE_DIR \
--keep-last $RETENTION_LASTS \
--keep-daily $RETENTION_DAYS \
--keep-weekly $RETENTION_WEEKS \
--keep-monthly $RETENTION_MONTHS \
--keep-yearly $RETENTION_YEARS &
wait $!
echo "Backup & cleaning is done."
echo "Backup is done."
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