Solved

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

Posted on 2011-09-28
7
858 Views
Last Modified: 2012-05-12
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
Comment
Question by:Tolgar
  • 4
  • 3
7 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 36718513
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
 
LVL 21

Expert Comment

by:mcsween
ID: 36718535
Just copy the contents of the crontab file from one server to another.  It is usually located under /var/spool/crontabs.
0
 
LVL 21

Expert Comment

by:mcsween
ID: 36718546
sorry I misread the question; listen to wool
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36718550
And how should cron recognize that there's a new crontab now?
0
 
LVL 21

Expert Comment

by:mcsween
ID: 36718582
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
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36718611
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
 
LVL 21

Expert Comment

by:mcsween
ID: 36718679
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now