User Tools

Site Tools


manual backup

(run as sudo)

- local backup

rsync -azvv  --exclude /var/log /etc /home /opt /var  /pathtofolderwherebackupisstored

- remote backup

rsync -azvv -e ssh /foldertobackup remoteuser@remotehost.remotedomain:/wheretostorebackup

to backup mysql database, it is enough to: 

 - stop mysql server

<code>/etc/init.d/mysql stop

- backup the contents of the /var/lib/mysql folder

rsync -azvv /var/lib/mysql /somewhere

- backup the database(s)

mysqldump -u root -ptmppassword --all-databases > /tmp/all-database.sql

source here

automated backup

(as sudo) run crontab:

crontab -e

edit the file, so that cronjob will run the command each 1st of the month, at 20:45

45 20 1 * *  rsync -azvv  --exclude /var/log /etc /home /opt /var  /srv/mis_duplicate/backingup

and backup the server (only folders /etc, /home, /opt, /var) to an external disk


rsync-backup.txt · Last modified: 2014/01/03 10:08 by zoza