#ssh hula2 'tar -cz /export/logs/account-collector/server.log.2009-11-*' | tar -xzv export/logs/account-collector/server.log.2009-11-01 export/logs/account-collector/server.log.2009-11-02 export/logs/account-collector/server.log.2009-11-03 export/logs/account-collector/server.log.2009-11-04 export/logs/account-collector/server.log.2009-11-05 export/logs/account-collector/server.log.2009-11-06 export/logs/account-collector/server.log.2009-11-07 export/logs/account-collector/server.log.2009-11-08 export/logs/account-collector/server.log.2009-11-09 #ls -R ~/export /home/user/export: logs /home/user/export/logs: account-collector /home/user/export/logs/account-collector: server.log.2009-11-01 server.log.2009-11-03 server.log.2009-11-05 server.log.2009-11-07 server.log.2009-11-09 server.log.2009-11-02 server.log.2009-11-04 server.log.2009-11-06 server.log.2009-11-08
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
ssh <host> -C blowfish-cbc 'tar -cz /<folder>/<subfolder>' | tar -xvz
to profile the different ssh ciphers on your machine, run this command:openssl speed aes rc4 blowfish
At least on debian/ubuntu, the openssl command comes with the 'openssl' package, which is probably available by default on most systems.ssh -C HOST 'tar -c PATH' | tar -xv
The advantage is that you can control the compression level, like:ssh -C -o CompressionLevel=9 HOST 'tar -c PATH' | tar -xv
time scp hula2:/export/logs/account-collector/server.log.2009-11-* .
server.log.2009-11-01 100% 43MB 8.5MB/s 00:05 server.log.2009-11-02 100% 44MB 10.9MB/s 00:04 server.log.2009-11-03 100% 21MB 10.5MB/s 00:02 server.log.2009-11-04 100% 2302KB 2.3MB/s 00:00 server.log.2009-11-05 100% 785MB 9.7MB/s 01:21 server.log.2009-11-06 100% 50MB 8.3MB/s 00:06 server.log.2009-11-07 100% 21MB 10.4MB/s 00:02 server.log.2009-11-08 100% 20MB 10.2MB/s 00:02 server.log.2009-11-09 100% 5171KB 5.1MB/s 00:01 server.log.2009-11-10 100% 343MB 8.8MB/s 00:39 server.log.2009-11-11 100% 109MB 9.1MB/s 00:12 server.log.2009-11-12 100% 109MB 8.4MB/s 00:13 real 2m46.731s user 0m25.078s sys 0m10.113stime ssh hula2 'tar -cz /export/logs/account-collector/server.log.2009-11-*' | tar -xvz
tar: Removing leading `/' from member names export/logs/account-collector/server.log.2009-11-01 export/logs/account-collector/server.log.2009-11-02 export/logs/account-collector/server.log.2009-11-03 export/logs/account-collector/server.log.2009-11-04 export/logs/account-collector/server.log.2009-11-05 export/logs/account-collector/server.log.2009-11-06 export/logs/account-collector/server.log.2009-11-07 export/logs/account-collector/server.log.2009-11-08 export/logs/account-collector/server.log.2009-11-09 export/logs/account-collector/server.log.2009-11-10 export/logs/account-collector/server.log.2009-11-11 export/logs/account-collector/server.log.2009-11-12 real 1m8.055s user 0m7.232s sys 0m5.428stime ssh -C hula2 'tar -c /export/logs/account-collector/server.log.2009-11-*' | tar -xv
tar: Removing leading `/' from member names export/logs/account-collector/server.log.2009-11-01 export/logs/account-collector/server.log.2009-11-02 export/logs/account-collector/server.log.2009-11-03 export/logs/account-collector/server.log.2009-11-04 export/logs/account-collector/server.log.2009-11-05 export/logs/account-collector/server.log.2009-11-06 export/logs/account-collector/server.log.2009-11-07 export/logs/account-collector/server.log.2009-11-08 export/logs/account-collector/server.log.2009-11-09 export/logs/account-collector/server.log.2009-11-10 export/logs/account-collector/server.log.2009-11-11 export/logs/account-collector/server.log.2009-11-12 real 1m28.785s user 0m13.613s sys 0m6.332s The ssh -C option is a good alternative but it probably compresses by packet, achieving a lower compression when compared to compression by file. Still the -C flag can be very useful. Thx for the additions guys.