LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 09-10-2007, 02:08 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,895

Rep: Reputation: 73
Auto RSYNC Over SSH via Cron?


Guys - I want to place the following cron job in my server so it can mirror the primary server which users constantly modify on a daily basis but I would like this to be done via CRON at night rather than me having to manually type these commands but when I issue the command as a test, it prompts me for a password which I can understand via SSH access to the machine but what happens if I place this in CRON, will it not run if nobody is there to enter the password? Is there a secure and trusted way to do this?

Code:
0 2 * * * rsync --delete -avz -e ssh root@10.1.1.24:/etc/passwd /etc
1 2 * * * rsync --delete -avz -e ssh root@10.1.1.24:/etc/shadow /etc
2 2 * * * rsync --delete -avz -e ssh root@10.1.1.24:/etc/group /etc
3 2 * * * rsync --delete -avz -e ssh root@10.1.1.24:/home /
4 2 * * * rsync --delete -avz -e ssh root@10.1.1.24:/share /
 
Old 09-10-2007, 02:12 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,568

Rep: Reputation: 510Reputation: 510Reputation: 510Reputation: 510Reputation: 510Reputation: 510
look up ssh key authentication. there are plenty of tutorials out there on how to do just this.
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are 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
Cannot execute rsync as a cron job jdaniels73 Linux - Software 2 09-03-2006 05:03 AM
how do I rsync & cron to fetch -current weekly? chess Slackware 3 09-11-2005 10:07 AM
auto ssh, and the rsync Swakoo Linux - Networking 5 08-25-2005 06:00 AM
using rsync with cron & pub. key kmitz Fedora 0 01-14-2005 08:01 AM


All times are GMT -5. The time now is 08:07 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration