Script de sauvegarde DiskStation
This commit is contained in:
commit
3f0fb35573
43
backup.sh
Normal file
43
backup.sh
Normal file
@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Setting this, so the repo does not need to be given on the commandline:
|
||||
export BORG_REPO='synology@nyanlout.re:/mnt/backup_loutre/diskstation_borg'
|
||||
|
||||
# Setting this, so you won't be asked for your repository passphrase:
|
||||
export BORG_PASSPHRASE='xxxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||
|
||||
echo "Starting backup on $BORG_REPO"
|
||||
|
||||
date=$(date "+%Y-%m-%dT%H:%M:%S")
|
||||
archiveName="diskstation-$date"
|
||||
basePath='/volume1/Sauvegardes'
|
||||
|
||||
# Backup the most important directories into an archive named after
|
||||
# the machine this script is currently running on:
|
||||
|
||||
borg create \
|
||||
--verbose \
|
||||
--list \
|
||||
--stats \
|
||||
--compression lz4 \
|
||||
\
|
||||
::$archiveName \
|
||||
\
|
||||
${basePath}/TREHIOU_THINKPAD \
|
||||
${basePath}/PC_CLAIRE \
|
||||
${basePath}/TREHIOU_HP
|
||||
|
||||
echo "Pruning repository"
|
||||
|
||||
# Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly
|
||||
# archives of THIS machine. The '{hostname}-' prefix is very important to
|
||||
# limit prune's operation to this machine's archives and not apply to
|
||||
# other machines' archives also:
|
||||
|
||||
borg prune \
|
||||
--verbose \
|
||||
--prefix 'diskstation-' \
|
||||
--keep-daily 7 \
|
||||
--keep-weekly 4 \
|
||||
--keep-monthly 6 \
|
||||
|
Loading…
Reference in New Issue
Block a user