Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-27-2006, 04:00 AM   #1
LQ Newbie
Registered: Oct 2006
Posts: 11

Rep: Reputation: 0
rsync in crontab

I want to rsync some data from one linux red hat 7.2 system to another, every half an hour.

what is the crontab file where I should make the entry and how should my entry look like?

Let's say, my user is = classy
ip adress of the source pc =
file to be picked up = /home/admin/classified

Your suggestions are very much appreciated.
Old 11-27-2006, 04:56 AM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I'm not familiar with rsync so you'll need to write the command yourself (it's just the same command you would normally use to rsync data from the other pc). You don't edit crontab files directly, but rather use the command crontab -e to start editing the file:

Log in as the user who's crontab you wish to edit and run
crontab -e
write and save changes, then exit. Alternatively use root account and run
crontab -eu classy
which should edit crontab for classy.

One line looks like
30 * * * * rsync-command with options here
that should run the given rsync-command (/bin/rsync .... or something) 30 minutes after full hour, every hour, every day of the month, every month and every day of the week, that is, every time clock is xx.30. If you like to run it every 30 minutes you could possibly combine that in one line, but you could just as well copy the line and set the other line be run 00 * * * * which means at full hours, which would result in running it at every 30 minutes. You could also set the first line be run 10 past and the second 40 minutes past, which would again be "every 30 minutes". As you like.
Old 11-27-2006, 09:32 AM   #3
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 257Reputation: 257Reputation: 257
First before you could set this up in a crontab, you'll need to setup ssh keys so it doesn't prompt for a password and never complete the data transfer.

But the rsync command would look something like this if added to b0uncer's cron post above:

rsync -a classy@ /local/dir/to/place/files/to
Old 11-28-2006, 04:08 AM   #4
LQ Newbie
Registered: Oct 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Hi Thanks so much for your suggestions.
They worked.

Have a good day.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 01:10 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 03:49 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 01:35 PM
Crontab Gorbachov Linux - Software 3 09-26-2003 05:40 PM
crontab help usman Linux - General 7 08-06-2003 04:37 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration