Solved

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

Posted on 2011-09-28
7
1,515 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 22

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 22

Expert Comment

by:mcsween
ID: 36718546
sorry I misread the question; listen to wool
0
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 
LVL 68

Expert Comment

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

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 22

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

623 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