Wednesday, May 29, 2013

Large log on the disk, what to do?

Probably more so, if the log is impt and needs to be saved. Here are a few solutions I gathered -

single file, tar is not required, multiple files may be we would want to tar it also. We will tar/gzip and throw the output to stdout which will be piped to a pv (to show the progress) which is piped to nc -l (netcat listener)

(on source)
1. single large file
 gzip -c filename | pv | nc -l 4545  
2. multiple large file or directory
tar czf - filename |  pv | nc -l 4545

(on target)

nc source-hostnmae 4545 > filename.gz  or nc source-hostnmae 4545 > filename.tar.gz

List directories via 'ls -d' - surprised me

List directories via 'ls -d' - surprised me This was one of those feelings where I was left surprised with the humble linux comm...