Safely Copy Directories in Unix

| | Comments (0)
I use this a lot when I need/want to mount a new partition into a directory location that I have been previously been using (i.e. Vinum configuration in FreeBSD). What's great for me is that it will copy file permissions over properly - and better yet, if it fails partway through you don't lose any data.
# mkdir newdir
# cd olddir
# tar -cf - . | ( cd newdir && tar -xf - )

Leave a comment

About this Entry

This page contains a single entry by Max Clark published on August 18, 2005 11:19 AM.

Search Rank was the previous entry in this blog.

Students Charged as Felony Hackers is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

View Max Clark's profile on LinkedIn
Powered by Movable Type 4.1