Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2212
  • Last Modified:

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,
0
Tolgar
Asked:
Tolgar
  • 4
  • 3
1 Solution
 
woolmilkporcCommented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now