Created
March 28, 2016 11:58
-
-
Save reox/3f006ad3e09cf35a027f to your computer and use it in GitHub Desktop.
Bup Backup using a remote BUP_DIR
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
#!/bin/bash | |
# creake a backup of several folders using bup | |
# Using $TARGET as $BUP_DIR | |
TARGET=/mnt/backup | |
FOLDERS="/etc /root /home /srv /var" | |
LOGFILE="$TARGET/logs/$(date +%Y%m%d_%H%M%S).log" | |
( | |
flock -n 200 | |
echo "Bup index..." | tee -a $LOGFILE | |
BUP_DIR=$TARGET bup index -ux $FOLDERS 2>&1 | tee -a $LOGFILE | |
echo "Bup Save..." | tee -a $LOGFILE | |
BUP_DIR=$TARGET bup save -n ceali $FOLDERS 2>&1 | tee -a $LOGFILE | |
find $TARGET/logs -mtime +7 -exec rm {} \; | |
) 200>/root/.backupinprogress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or using a remote target: