Howto Use Tar and Pipe to Copy Whole Directory Structure on Solaris

There are times, that you want to copy or move your files/directories from one place to another. Especially if you have millions of files, or have very big files (10G,20G,30G or even bigger), or have so many symlinks, you can encounter problems very often…
On my system, what i wanted to do was copy the whole directory structure, including symlinks and permissions, to another directory.
Please beware of the “E” switch when tarring and un-tarring, as this switch will help you to tar files bigger than 8G…
The command is quite simple. Go into the directory where you want to copy your files (on my example, i want to move everything inside /oldfs/global/u01 directory to /global/u01

root@tkcl2 # cd /oldfs/global/u01
root@tkcl2 # nohup tar -cpBEf – * | ( cd /global/u01; tar xBEf – ) &

That should do the trick… I used nohup to be safe against a disconnection…

Be the first to comment on "Howto Use Tar and Pipe to Copy Whole Directory Structure on Solaris"

Leave a comment

Your email address will not be published.


*