使用 tar命令經由ssh作備份
Backup Command line
# tar zcvf - /www | ssh [email protected] "cat > /backup/www.tar.gz"
# tar zcvf - /www | ssh [email protected] "dd of=/backup/www.tar.gz"
# tar zcvf - /www | ssh [email protected] "cat > /dev/nst0" //備份至遠端Tap driver
# tar zcvf - /www | ssh [email protected] $(mt -f /dev/nst0 rewind; cat > /dev/nst0)$ //備份至遠端Tap driver
# tar zcvf - /www | ssh [email protected] "cat > /backup/www.tar.gz"
# tar zcvf - /www | ssh [email protected] "dd of=/backup/www.tar.gz"
# tar zcvf - /www | ssh [email protected] "cat > /dev/nst0" //備份至遠端Tap driver
# tar zcvf - /www | ssh [email protected] $(mt -f /dev/nst0 rewind; cat > /dev/nst0)$ //備份至遠端Tap driver
Restore Command line
cd /tmp
# ssh [email protected] "cat /backup/www.tar.gz" | tar zxvf -
參考資料: http://www.cyberciti.biz/faq/howto-use-tar-command-through-network-over-ssh-session/