feat: add scheduled backups with borg
This commit is contained in:
parent
7c897dbfc2
commit
edb34572a0
4 changed files with 73 additions and 0 deletions
57
bin/.local/bin/backup.sh
Executable file
57
bin/.local/bin/backup.sh
Executable file
|
@ -0,0 +1,57 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
rsync-cmd() {
|
||||
if [[ -n "$1" ]]; then
|
||||
dry_run="--dry-run"
|
||||
fi
|
||||
|
||||
rsync --verbose \
|
||||
--recursive \
|
||||
--links \
|
||||
--perms \
|
||||
--times \
|
||||
-D \
|
||||
--update \
|
||||
--delete-after \
|
||||
--compress \
|
||||
--human-readable \
|
||||
--progress \
|
||||
--partial \
|
||||
$dry_run \
|
||||
"$HOME/Progs" "$HOME/Téléchargements" tria.waarp.org:~/backup
|
||||
}
|
||||
|
||||
#case $1 in
|
||||
# "test")
|
||||
# rsync-cmd true
|
||||
# ;;
|
||||
# *)
|
||||
# rsync-cmd
|
||||
# ;;
|
||||
#esac
|
||||
|
||||
export BORG_REPO="tria.waarp.org:~/borg-backups"
|
||||
export BORG_PASSCOMMAND='secret-tool lookup borg passphrase'
|
||||
|
||||
borg create \
|
||||
--verbose \
|
||||
--filter AME \
|
||||
--list \
|
||||
--stats \
|
||||
--show-rc \
|
||||
--compression zstd,11 \
|
||||
"::$(date --iso-8601=minute)" \
|
||||
"$HOME/Progs" \
|
||||
"$HOME/Téléchargements"
|
||||
|
||||
borg prune \
|
||||
--list \
|
||||
--show-rc \
|
||||
--keep-hourly 24 \
|
||||
--keep-daily 7 \
|
||||
--keep-weekly 4 \
|
||||
--keep-monthly 6 \
|
||||
--keep-yearly 1
|
||||
|
||||
borg compact
|
||||
borg info
|
Loading…
Add table
Add a link
Reference in a new issue