How to move crontab from one server to another?

I have a list of crontab jobs, I would like to move them without re-typing .. How can we do that is there any command?
LVL 5
CalmSoulAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shiju JacobInfo Security ManagerCommented:
do crontab -l on the source server and copy to destination server /etc/crontab file and save it
0
Jeffrey Dake Senior Director of TechnologyCommented:
I would just scp the file from one server to the other.

http://en.m.wikipedia.org/wiki/Secure_copy
0
TintinCommented:
Depends where the cronjobs are defined.

If they are in /etc/cron.daily /etc/cron.weekly or /etc/cron.monthly, then just scp the files in those directories to the new server.

Otherwise, do

crontab -l >/tmp/cronjobs
scp cronjobs user@newserver
ssh newserver "crontab /tmp/cronjobs"
0
Gerwin Jansen, EE MVETopic Advisor Commented:
Open PuTTY to both servers, do crontab -l on one and crontab -e on the other. Copy lines from one to the other, do this for each cron user.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SandyCommented:
cron jobs are stored in /var/spool/cron/<user_name> and if you perform #scp from one to another system it will work

TY/SA
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.