#! /bin/bash # # Server_Sync: Syncronize this backup server with # the master server (150.1.91.245) # Run via cron - every night at 1:30am # 30 1 * * * /usr/local/sbin/Server_Sync ###### # # The files are stored in /root/.. # # /root/config/ contains the network information # that is specific to this fail-over server # (the only information that is different # from the master) # # /root/master_backup/ contains the latest backup # image from the master server # # Grab the latest backup from the Master Server # cd /root/master_backup sftp root@10.1.1.44:/backup/daily/sysbackup.tar.gz.1 # Note: I've already setup root sftp to work without # passwords between the Fail-over and the Master # using a randomly generated RSA key # # Write over the Fail-over configs using the backed-up # configs from the Master # The configuration files to overwrite are defined in # /root/config/conf_files # # Example for Mailscanner server: # etc/mail # etc/aliases # etc/aliases.db # etc/MailScanner # usr/local/sbin # usr/local/bin # usr/local/uvscan # cd / tar -T /root/config/conf_files -xzf /root/master_backup/sysbackup.tar.gz.1 # Restart the Mail services after the configuration update /etc/rc.d/init.d/squid restart