rsync daemon for opt zimbra

1. mv /opt/zimbra /opt/zimbra.old

2.set cronjob for data migration

34 22 21 * * /bin/sh /home/sas/opt.sh >>/home/sas/optzimbra.log

3.create scripts in /home/sas/

create optzimbra.sh and pass

chmod optzimbra.sh 754

[root@mail sas]# cat optzimbra.sh
#!/bin/sh
T1=`date`

rsync -avz –password-file=/home/sas/pass -u  root@115.112.176.21::opt/zimbra  /opt/ > /home/sas/opt.log  2>&1

T2=`date`

echo “START : ” $T1  >> /home/sas/opt.log
echo “END : ” $T2  >> /home/sas/opt.log

set same password from live server from /etc/rsyncd.secrets

chmod 400 pass

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

Leave a Comment

Your email address will not be published. Required fields are marked *

Open chat