Elementi koji se backup-uju:
- Baza
- Home folder
- Tomcat (opciono)
Uputstvo korak-po-korak
Sve elemente smestiti u poseban direktorijum (u ovom primeru će se zvati "backup"), napravljen za potrebe backup-a i restore-a.
Backup
service tomcat stop cd /tmp mkdir backup cd backup
Baza:
mysqldump --single-transaction netiis > netiis_backup.sql
Home folder:
tar -czf home_backup.tgz /home/netiis/
Tomcat:
tar -czhf tomcat.backup.tgz /usr/local/tomcat/
service tomcat start
Restore
cd /tmp/backup service tomcat stop Privremeno zakomentarisati jedan red u crontab skripti (#): crontab -e #*/10 * * * * /home/netiis/bin/provera
Baza:
mysql (ulazak u bazu) drop database netiis; create database netiis; ctrl+c (izlazak iz baze) mysql netiis < netiis_backup.sql
Home folder:
tar -xzf home_backup.tgz cd /home mv netiis netiis.old mv /tmp/backup/home/netiis/ .
Tomcat (opciono):
tar -xzf tomcat.backup.tgz mv /tmp/backup/tomcat /usr/local/
Odkomentarisati isključeni red u crontab skripti: crontab -e */10 * * * * /home/netiis/bin/provera service tomcat start