Created
September 5, 2015 12:39
-
-
Save Yanpas/158dcd533d067d1c3cb1 to your computer and use it in GitHub Desktop.
backup data
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 | |
# | |
datadrive="/home/$USER/.D" | |
extdrive="/media/$USER/externaldrive/Backup" | |
rkeys="--stats \ | |
--recursive \ | |
--times \ | |
--verbose \ | |
--delete \ | |
--exclude=*photothumb.db \ | |
--exclude=*.Trash-1000 \ | |
--exclude=*desktop.ini \ | |
--exclude=*Thumbs.db \ | |
--delete-excluded" | |
cd | |
if [ -a /media/$USER/externaldrive/.syncbool ] && [ -a $datadrive/.syncbool ] | |
then | |
echo "STARTING SYNC" | |
echo "_______________________"|tee >.sync.log | |
echo "DIR1==================="|tee >>.sync.log | |
rsync $rkeys $ddrive/dir1/ $extdrive/dir1|tee -a .sync.log | |
echo " | |
################## | |
Synced succesfully | |
################## | |
" | |
sleep 180 | |
else | |
echo "Drive wasn't connected" | |
sleep 18 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment