LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


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

Rep: Reputation: 0
rsync in crontab


Hi
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 = 192.150.200.1
file to be picked up = /home/admin/classified


Your suggestions are very much appreciated.
 
Old 11-27-2006, 03:56 AM   #2
b0uncer
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
Code:
crontab -e
write and save changes, then exit. Alternatively use root account and run
Code:
crontab -eu classy
which should edit crontab for classy.

One line looks like
Code:
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, 08:32 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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@192.150.200.1:/home/admin/classified /local/dir/to/place/files/to
 
Old 11-28-2006, 03:08 AM   #4
loonykroons
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.
 
  


Reply


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 12:10 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM
Crontab Gorbachov Linux - Software 3 09-26-2003 04:40 PM
crontab help usman Linux - General 7 08-06-2003 03:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:52 PM.

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