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

Posted on 2011-09-28
Last Modified: 2012-05-12
I have two Unix machine. I want to copy (rsync) the cron file from one machine to another.  

How can I do that?


Is it secure to do it?

Question by:Tolgar
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
LVL 68

Accepted Solution

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!


LVL 22

Expert Comment

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

Expert Comment

ID: 36718546
sorry I misread the question; listen to wool
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

LVL 68

Expert Comment

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

Expert Comment

ID: 36718582
Depending on your flavor of Linux/Unix it should check in every so often but you could use

crontab -e


/etc/init.d/crontab stop && /etc/init.d/crontab start
LVL 68

Expert Comment

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).

LVL 22

Expert Comment

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.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Centos 7 DNS server not replying to clients 3 99
Granting root permissions to a user (in Debian Jessie) 17 86
check the file dates in unix 14 77
umask commands 5 20
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

752 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