Skip to content

Instantly share code, notes, and snippets.

@Yanpas
Created September 5, 2015 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yanpas/158dcd533d067d1c3cb1 to your computer and use it in GitHub Desktop.
Save Yanpas/158dcd533d067d1c3cb1 to your computer and use it in GitHub Desktop.
backup data
#!/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