备份恢复 - linux系统用什么做备份比较好?
怪我咯
怪我咯 2017-04-17 16:14:55
0
7
426

windows可以用ghost,那么linux用什么好呢?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(7)
刘奇

rsync+btrfs+dm-crypt Backup the entire system - Evian's Blog.

In fact, it is recommended to use a file system that supports snapshots, such as zfs or btrfs (you can also use solutions such as LVM), otherwise there may still be consistency problems with online backup (for example, the PostgreSQL document clearly states that if you do not use snapshots way, it does not guarantee that your backup will be available).

伊谢尔伦

Directly rsync the corresponding directory

伊谢尔伦

You can try to make a mirror

PHPzhong

For industrial-grade backup, please write your own program to achieve at least the following functions:

1. Data replication, supports local replication and network replication.

2. Data verification.

Many people think that backup is just copying without verification, which leads to various problems in the end.

洪涛

ddTo file; finished...

左手右手慢动作

Backup/Restore Linux with tar

备份系统(可以在运行时备份):
sudo su
cd /
tar pczf bak.tgz \
--exclude=/bak.tgz \
--exclude=/cdrom \
--exclude=/dev \
--exclude=/lost+found \
--exclude=/media \
--exclude=/mnt \
--exclude=/proc \
--exclude=/run \
--exclude=/sys \
--exclude=/tmp \
/
其中--exclude的作用是排除.

还原系统(建议在启动U盘(LiveCD)下还原):
sudo su
tar pxzf bak.tgz -C /
mkdir cdrom dev lost+found media mnt proc run sys tmp
参数p表明保留原文件的属性(属性不会依据使用者而变)

Backup/Restore MBR with dd

备份MBR:
dd if=/dev/sda of=/tmp/mbr bs=512 count=1
恢复MBR:
dd if=/tmp/mbr of=/dev/sda bs=512 count=1
刘奇
rsync -aAXv /* /path/to/save/backup --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/path/to/backup/*}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!