Last active
April 21, 2019 10:15
-
-
Save alhoo/26c1321f14e2c3550ac40067f367a7e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat bin/backups.sh | |
#!/usr/bin/env bash | |
# sudo apt-get install rdiff-backup | |
BACKUPS="$HOME/backups" | |
rdiff-backup --exclude $BACKUPS \ | |
--exclude $HOME/VirtualBox\ VMs \ | |
--exclude $HOME/Downloads \ | |
$HOME $BACKUPS | |
if [ $(df -h $BACKUPS|grep -Po "([0-9]+)(?=%)") -gt 66 ]; then | |
# Remove old backups if we do not have a lot of space | |
rdiff-backup --remove-older-than 20W $BACKUPS | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment