ssh is useful for more than just opening a terminal session to servers. You can also pipe standard input and output in and out of ssh. This is the command I used to compress a log file on the remote host and save it on my local disk, all in one command and not intermediate file saved on the remote host:
ssh host '( cd /usr/local/app/log/ && tar -jcvf - production.log)' > /tmp/app_production.log.tar.bz2
It is so useful I thought it was worth a reminder.
Als je mijn backup hoofdstuk hier bekijkt, dan zie je voorbeelden van ssh in combinatie met tar, cpio, gzip etc.
ReplyDeletehttp://www.cobbaut.be/lt/
groetjes,
paul