Linux Tips: Difference between revisions
Jump to navigation
Jump to search
Line 9: | Line 9: | ||
When copying a directory that contains a lot of small files (like 1000+ files <1kB), it is faster to actually generate a tarball of the directory and have it unpacked on the fly on the destination server [http://www.4bcj.com/post/2008/01/Fast-File-Copy---Linux!.aspx]: |
When copying a directory that contains a lot of small files (like 1000+ files <1kB), it is faster to actually generate a tarball of the directory and have it unpacked on the fly on the destination server [http://www.4bcj.com/post/2008/01/Fast-File-Copy---Linux!.aspx]: |
||
<source lang="bash"> |
<source lang="bash"> |
||
# On DESTINATION box, launch first the listener |
|||
Destination$ nc -l -p 2342 | tar -C /target/dir -xzf - |
|||
nc -l -p 2342 | tar -C /target/dir -xzf - |
|||
#On SOURCE box, launch the sender |
|||
tar -cz /source/dir | nc Target_Box 2342 |
|||
</source> |
</source> |
||
Revision as of 07:57, 15 September 2010
Disable Auto-Mount
You can temporarily disable automount by doing as root [1]:
$ rcdbus stop
Fast Copy
Using Netcat
When copying a directory that contains a lot of small files (like 1000+ files <1kB), it is faster to actually generate a tarball of the directory and have it unpacked on the fly on the destination server [2]:
# On DESTINATION box, launch first the listener
nc -l -p 2342 | tar -C /target/dir -xzf -
#On SOURCE box, launch the sender
tar -cz /source/dir | nc Target_Box 2342
Other
See here