LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Auto RSYNC Over SSH via Cron? (https://www.linuxquestions.org/questions/linux-general-1/auto-rsync-over-ssh-via-cron-583682/)

carlosinfl 09-10-2007 02:08 PM

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 /


AlucardZero 09-10-2007 02:12 PM

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


All times are GMT -5. The time now is 08:28 PM.