Created
October 6, 2015 11:41
-
-
Save duchenpaul/fdcac1a866a80dcac82a to your computer and use it in GitHub Desktop.
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 | |
TIMESTAMP=$(date +%F) | |
ssh -i /home/pi/.ssh/id_rsa_3072 [email protected] <<'ENDSSH' | |
#commands to run on remote host | |
rm reaver_backup_*.zip; | |
zip -r ~/reaver_backup_`date +"%Y%m%d"`.zip /usr/local/etc/reaver; | |
scp -i /root/.ssh/id_rsa_3072 ~/reaver_backup*.zip [email protected]:~/; | |
exit | |
ENDSSH | |
subject="Reaver Saving File Backup on $(date +%F)" | |
content="Here is the reaver saving file backup on `date "+%B %d %Y"`: reaver_backup_`date +"%Y%m%d"`.zip" | |
python /home/pi/run/send_mail.py "$subject" "$content" -f /home/pi/reaver_backup_*.zip | |
sudo rm /home/pi/reaver_backup_*.zip | |
logger "The reaver backup file: reaver_backup_`date +"%Y%m%d"`.zip has been sent" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment