Keep your MongoDB staging server up to date with rsync and crontab

Tom Nagle
Tom Nagle
Apr 1 · 2 min read
ssh-keygen -f ~/.ssh/id_rsa -q -P ""
cat ~/.ssh/id_rsa.pub
~/.ssh/authorized_keys
rsync -avz ssh ~/db_backups/ root@staging.example.com:~/db_backups
nano ~/scripts/backup.sh
crontab -e00 18 * * 1-5 ~/scripts/backup.sh >> /root/temp/backup.txt
nano ~/scripts/restore.sh
crontab -e15 18 * * 1-5 ~/scripts/restore.sh >> /root/temp/restore.txt

Tom Nagle

Written by

Tom Nagle

I am a full stack JavaScript developer with Scrum and team lead experience. My preferred stack is Mongoose, TypeScript, Node.js, React & GraphQL.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade