Rexxer

Some tips for me and other

Linux backup

Проводилось на CentOs5.

Монтируем виндовую шару:

mount -t cifs //192.168.0.1/Backup -o username=administrator,password=password /mnt

Бэкапим:

/sbin/dump -0uan -f – / | gzip -2 | dd of=/mnt/serverbackup-`date ‘+%d-%B-%Y’`.dump.gz

From one of blogs:

The best tool to use for this is probably dump, which is a standard linux tool and will give you the whole filesystem. I would do something like this:

/sbin/dump -0uan -f - / | gzip -2 | ssh -c blowfish user@backupserver.example.com dd of=/backup/server-full-backup-`date '+%d-%B-%Y'`.dump.gz

This will do a file system dump of / (make sure you don’t need to dump any other mounts!), compress it with gzip and ssh it to a remote server (backupserver.example.com), storing it in /backup/. If you later need to browse the backup you use restore:

restore -i

Another option, if you don’t have access to dump is to use tar and do something like

tar -zcvpf /backup/full-backup-`date '+%d-%B-%Y'`.tar.gz --directory / --exclude=mnt --exclude=proc --exclude=tmp .

But tar does not handle changes in the file system as well.

Leave a Reply