Last active
December 26, 2015 07:29
-
-
Save NiklasMM/7115336 to your computer and use it in GitHub Desktop.
One line file backup script
This file contains hidden or 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 | |
SOURCE_DIR=/home/niklas/ | |
TARGET_DIR=/media/Backup/FileBackup | |
EXCLUDE_FILE=/home/niklas/rsync_excludelist | |
rsync -avP --exclude-from=${EXCLUDE_FILE} --delete-excluded --delete --stats ${SOURCE_DIR} ${TARGET_DIR} | |
# add log entry to target dir | |
LOGFILE="$TARGET_DIR/backup_log" | |
DATE=$(date) | |
echo "Last backup on $DATE" >> $LOGFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obviously you have to adjust the paths...