以下操作在cent os上进行
1.在server主机中把/etc目录打包压缩到/mnt中,名字为etc.tar.gz
2.复制server主机中的etc.tar.gz到desktop主机的/mnt中
3.同步server主机中的/etc中的所有文件到desktop主机中/mnt中,包含链接文件
1.
[root@localhost mnt]# tar -czf etc.tar.gz /etc
tar: Removing leading `/' from member names
[root@localhost mnt]# ll
total 10356
-rw-------. 1 root root 10604447 4月 10 10:47 etc.tar.gz
drwxrwxr-t. 2 test root 6 4月 3 22:24 new
drwSr--r--. 2 test newgroup 6 4月 3 22:25 new2
drwxrwsrwx. 2 root root 6 4月 3 22:25 new3
drwxr-xr-x. 2 root root 6 3月 27 10:54 VERSION
2.[root@localhost mnt]# scp ./etc.tar.gz root@172.25.254.111:/root/
3[root@localhost mnt]# rsync ./etc.tar.gz root@172.25.254.111:/root/
本文介绍了如何在CentOS系统中使用tar命令将/etc目录压缩并保存至/mnt路径下,名为etc.tar.gz。接着通过scp命令将此压缩包从server主机传输到desktop主机的/root/目录,并使用rsync命令实现两台主机间/etc目录文件的同步。
:文件的归档与压缩&spm=1001.2101.3001.5002&articleId=69943927&d=1&t=3&u=14365bd35d104a01a725f90a67578b3b)
2027

被折叠的 条评论
为什么被折叠?



