Skip to content

Instantly share code, notes, and snippets.

@patrickkeller
Created May 19, 2013 13:48
Show Gist options
  • Save patrickkeller/5607684 to your computer and use it in GitHub Desktop.
Save patrickkeller/5607684 to your computer and use it in GitHub Desktop.
Get MongoDB backup from backup_mongo script
#!bin/sh
keyfile=""
remote_source="/var/mongobackup/*.tar.gz"
day_of_week="$(date +'%A')"
backup_dest="/home/apbackup/web4fm/${day_of_week}"
tmp_dest="/tmp/"
# scp copy
scp -i $keyfile deploy@80.74.150.148:$remote_source $tmp_dest
# remove old backup
rm -rf "${backup_dest}/*"
# move to day of week folder from tmp
mv "/tmp/*tar.gz" $backup_dest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment