Advertisement
postcd

Untitled

Jul 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.92 KB | None | 0 0
  1. while true;do
  2. rsync command here (syncing probably only mysql and /home folders ?)
  3. if [[ "$(comand to discover whether ip is routed on the old or new machine)" == *"something"*]];then
  4. # ip was re-routed, we stop this source VPS services and do last sync. (destination VPS services are already stopped not to do any mess)
  5. service chksrvd stop;service cpanel stop;service httpd stop;service mysqld stop;service exim stop;service pure-ftpd stop
  6. rsync command here (syncing probably only mysql and /home folders ?)
  7. ssh destinationvps -p port "service chksrvd start && service cpanel start && service httpd start && service mysqld start && service exim start && service pure-ftpd start"
  8. # above command assuming there is already password less access
  9. # ip was re routed and i achieved nearly 1:1 clone. 1:1 clone in case of mysql and website files because cpanel, ftp, httpd, mysqld, exim.. was stopped before last rsync
  10. fi
  11. sleep 1
  12. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement