How can I copy a cron file from one machine to another machine?

Hi,
I have two Unix machine. I want to copy (rsync) the cron file from one machine to another.  

How can I do that?

and

Is it secure to do it?

Thanks,
TolgarAsked:
Who is Participating?
 
woolmilkporcConnect With a Mentor Commented:
crontab -l > tempfile

(rsync tempfile to other system)

On other system:

crontab tempfile

Take care to log in as the crontab owner on both systems!

wmp

0
 
mcsweenSr. Network AdministratorCommented:
Just copy the contents of the crontab file from one server to another.  It is usually located under /var/spool/crontabs.
0
 
mcsweenSr. Network AdministratorCommented:
sorry I misread the question; listen to wool
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
woolmilkporcCommented:
And how should cron recognize that there's a new crontab now?
0
 
mcsweenSr. Network AdministratorCommented:
Depending on your flavor of Linux/Unix it should check in every so often but you could use

crontab -e

or

/etc/init.d/crontab stop && /etc/init.d/crontab start
0
 
woolmilkporcCommented:
So if you must issue a command like crontab on the target system anyway - why not use it on both ends?

It's consistent and compatible with almost all Unix flavors (well not with ESX(i) but that's another question).

wmp
0
 
mcsweenSr. Network AdministratorCommented:
I'm not sure why you are trying to argue with me but if you read above I said I misread the question and to ignore my response.  Please help the person asking the question instead.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.