Created
February 16, 2016 18:00
-
-
Save avishekrk/772900bb90bdb70752ec to your computer and use it in GitHub Desktop.
Stampede 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 | |
DEST="[email protected]:~/DFI" | |
SRCs="/home1/02672/avishek/scratch/InterfacesProject/1fsa/1fsa " | |
bckup(){ | |
rsync -avz -i -h --log-file=$(basename $1)_bckup.txt ${1} ${DEST} | |
} | |
for src in ${SRCs}; do bckup ${src}; done | |
SUBJECT="Stampede Backup Report $(date +%F)" | |
EMAIL="[email protected]" | |
logmail(){ | |
printf "${SUBJECT}\n\n" | |
printf "====================================\n\n" | |
for src in ${SRCs}; | |
do | |
printf "${src}\n" | |
cat $(basename ${src})_bckup.txt | |
printf "==================================\n\n" | |
done | |
rm *_bckup.txt | |
} | |
logmail | mail -s "${SUBJECT}" ${EMAIL} | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment