Backup of merce on a location


HOW TO TAKE BACKUP FROM MERCE VIA XBACKUP?
Suppose we want to take the backup of NFL Noida to its gatekeeper whose ip is 10.20.30.40 in
the directory /var/warehouse/noidabackup. Before deciding where to take backup please check
the whether enough size is available or not in the destination directory by executing
"df -h".


The following steps are required to be followed :

  1. Xbackup uses rsync to bakcup the data and its configuration file is /etc/merce/xbackup.conf
  2. In case of Merce we take the backup of the database and the following directory content
    1. /etc/
    2. /opt/merce/
    3. /var/lib/merce
    4. /var/lib/named
    5. /var/spool/imap
    6. /var/lib/imap
    7. /var/spool/uucp
  3. Create the structure of the above directories with respect to the backup directory on destination i.e. execute
    • mkdir -p /var/warehouse/noidabackup/etc/
    • mkdir -p /var/warehouse/noidabackup/opt/merce
    • mkdir -p /var/warehouse/noidabackup/var/lib/merce
    • mkdir -p /var/warehouse/noidabackup/var/lib/named
    • mkdir -p /var/warehouse/noidabackup/var/spool/imap
    • mkdir -p /var/warehouse/noidabackup/var/lib/imap
    • mkdir -p /var/warehouse/noidabackup/var/spool/uucp
  4. Backup of database
    • look up to the root password for mysql dbase in /etc/merce/passwords.txt
    • execute as root: mysqldump -u root -p merce > /var/tmp/merce_dbase_20060602.sql
    • enter password when prompted
  5. Configure xbackup on the source from which backup is to be taken.
    • For taking backup of the above directories recursively set the variable TASKPATH
    • TASKPATHS="
      /etc/%root@10.20.30.40:/var/warehouse/noidabackup/etc/%
      /opt/merce/%root@10.20.30.40:/var/warehouse/noidabackup/opt/merce/%
      /var/lib/merce/%root@10.20.30.40:/var/warehouse/noidabackup/var/lib/merce/%
      /var/lib/named/%root@10.20.30.40:/var/warehouse/noidabackup/var/lib/named/%
      /var/spool/imap/%root@10.20.30.40:/var/warehouse/noidabackup/var/spool/imap/%
      /var/lib/imap/%root@10.20.30.40:/var/warehouse/noidabackup/var/lib/imap/%
      /var/spool/uucp/%root@10.20.30.40:/var/warehouse/noidabackup/var/spool/uucp/%
      "

    • there is an option GLOBAL_RSYNC_OPTS="-W". This says that when taking backup
      take backup of the "whole" directory irrespective of whether that backup is already
      present on destination machine
  6. Shutdown uucp service if any
    • netstat -anp | grep :540
    • if it shows the xinetd as result cd /etc/xinetd.d/
    • vi uucp
    • change the variable "disable=no" to "disable=yes"
    • restart xinted /etc/init.d/xinted.d restart
    • crontab -e -u uucp
    • comment the uucico entry
  7. run xbackup as : nohup /opt/merce/sbin/xbackup > /var/tmp/xbackup.out
    2>/var/tmp/xbackup.err&
  8. continously monitor /var/tmp/xbackup.out and /var/tmp/xbackup.err
  9. if there is an entry in xbackup.err saying that rsync has stopped please check
    the status of the same via ps -ef | grep rsync.
  10. ps -ef | grep xbackup
  11. kill xbackup and restart. Please note that if at all due to any reason you kill
    xbackup remember that xbackup spawns out a process of rsync so that even if the
    parent (xbackup) might be killed the child (rsync) would still be running. Hence
    kill rsync first and then xbackup.
  12. If xbackup stops half way through and you want to restart xbackup after
    comparison on the source and destination side you can delete the taskpaths for whom
    the backup has already been taken and restart xbackup
  13. After completion of backup check the status on the source and destination
    machine by executing "du -sh "
  14. Sometimes the backup size of the destination machine would be higher than that
    of the source. This might be because when you have taken backup of the mails some
    users having pop accounts download mails on their machines.
  15. In some cases after you have taken the backup of a machine you might be
    required to take the backup again after 1-2 days. This time you want to copy just
    the data which has been appended to those directories and not everything. For this
    incremental data backup change the option GLOBAL_RSYNC_OPTS="-W" to
    GLOBAL_RSYNC_OPTS="".