Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- REPOSITORY=ssh://francescoprovino@path/to/backup
- # Setting this, so you won't be asked for your repository passphrase:
- export BORG_PASSPHRASE='XXXXXXXXXXXXXX'
- # or this to ask an external program to supply the passphrase:
- export BORG_PASSCOMMAND='pass show backup'
- nextcloud.occ maintenance:mode --on
- # Backup all of /home and /var/www except a few
- # excluded directories
- borg create -v -p --stats \
- --compression lz4 \
- $REPOSITORY::'{hostname}-{now:%Y-%m-%d}' \
- /var/snap/nextcloud/
- # 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 machine's archives also.
- nextcloud.occ maintenance:mode --off
- borg prune -v --list --prefix '{hostname}-' --keep-last 10 $REPOSITORY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement