Friday, July 26, 2013

Rsyn configuration to sync between 2 servers

1) First create passwordless authentication between 2 servers

2) Create the rsync script to copy from source to destination

#!/bin/bash
echo `date` >>/tmp/output.txt

echo "############" >> /tmp/output.txt

rsync -arvz /u01/app/agilevault/  10.16.3.242:/u01/app/agilevault/  >> /tmp/rsync_log.txt  2>&1

echo "###########" >> /tmp/output.txt


3) Set the cron job to run after every 3 hours


crontab -l
* */3 * * * /home/oracle/rsync.sh

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home