tar 远程备份

#传输到远程:
tar czf - file| ssh server "tar zxf -"
#压缩到远程:
tar czf - file| ssh server "cat > file.tar.gz"
#解压到远程:
ssh server "tar zxf -" < file.tar.gz
#解压到本地:
ssh server "cat file.tar.gz" | tar zxf -

参考
http://www.cszhi.com/20120513/tar-ssh.html
http://www.cnblogs.com/wjoyxt/p/4842924.html

© 2017, 新之助meow. 原创文章转载请注明: 转载自http://www.xinmeow.com

0.00 avg. rating (0% score) - 0 votes
点赞