Server Migration - Synch Cron Tab via SSH
Jan 4, 2012 · 1 minute readCategory: linux
If you are handling a server migration and would like to have a scripted way to copy the crontab from one machine to the other then you might like this little snippet.
ssh -p2020 root@123.123.123.123 'crontab -l' | crontab -
This will get the contents of the root crontab from one server and apply it to the current server, replacing any current cron tab settings.
This is nice if you want to have a repeatable server resynch process whilst you are migrating and the crontab on the old server may change