如何备份ubuntu
备份ubuntu的方法:
1.打开终端,输入“$ sudo su”成为root用户。
2.再进入文件系统的根目录,命令:
#cd/
3.使用以下命令备份系统:
#tarcvpzfbackup.tgz–exclude=/proc–exclude=/lost+found–exclude=/backup.tgz–exclude=/mnt–exclude=/sys./*
程序例如:
tarcvpzfbackup.tgz–exclude=/proc–exclude=/lost+found–exclude=/backup.tgz–exclude=/mnt–exclude=/sys./*remark:tar:Cowardlyrefusingtocreateanemptyarchive
有时候在打包的时候,某个目录还是是文件不需要打包备份,比如服务器上上传的图片很大就不需要打包备份。
打包以下命令:
tar-czvf/root/test.tar.gz--exclude=php./*
本文来源:https://www.yuntue.com/post/76686.html | 云服务器网,转载请注明出处!

微信扫一扫打赏
支付宝扫一扫打赏