rsync daemon for opt zimbra
1. mv /opt/zimbra /opt/zimbra.old
2.set cronjob for data migration
3.create scripts in /home/sas/
cat mswc-daily.sh
cat mswc-weekly.sh
2.set cronjob for data migration
15 15 * * 1,2,3,4,5,6 /bin/sh /home/sas/mswc-daily.sh
06 15 * * 7 /bin/sh /home/sas/mswc-weekly.sh
3.create scripts in /home/sas/
cat mswc-daily.sh
#!/bin/sh
T1=`date`
rsync -avz --update --password-file=/home/sas/pass-mswc root@192.227.110.100::opt/ /mswc-mirror/opt/zimbra/ > /home/sas/logs/mswc.log 2>&1
T2=`date`
echo "START : " $T1 >> /home/sas/logs/mswc.log
echo "END : " $T2 >> /home/sas/logs/mswc.log
cat mswc-weekly.sh
#!/bin/sh
T1=`date`
rsync -avz --delete --password-file=/home/sas/pass-mswc root@192.227.110.100::opt/ /mswc-mirror/opt/zimbra/ > /home/sas/logs/mswc-weekly.log 2>&1
T2=`date`
echo "START : " $T1 >> /home/sas/logs/mswc-weekly.log
echo "END : " $T2 >> /home/sas/logs/mswc-weekly.log
abc@123
set same password from live server from /etc/rsyncd.secrets
chmod 400 /home/sas/pass-mswc
enter the opt location in rsync.conf of live server from where you want to fetch data
[opt]
path = /opt
comment = An Example
auth users = root
secrets file = /etc/rsyncd.secrets
read only = no
uid = root
gid = root
use chroot = yes
cat /etc/rsyncd.secrets
root:abc@123
sudo chmod 600 /etc/rsyncd.secrets (else error @ERROR: auth failed on module home)
Comments
Post a Comment