Jump to content

Moving /usr - how to copy everything?


ffrr
 Share

Recommended Posts

In my opinion, the best way to replicate a directory tree (or even more than that), is using tar:

# (cd /source/parent/ && tar cf - things.to.replicate) | (cd /destination/folder/ && tar xpf -)

"things.to.replicate" can be a list of files and/or directories, or even a simple dot (.) for duplicating the whole current directory (current being "/source/parent/" here).

 

Yves.

 

Agreed :D for a few variatins like :

tar cf - . | (cd /mnt/$TARGET && tar xBf -)

 

 

(don't miss the full stop either)

 

 

unix power tools

 

 

 

Great solutions !

Link to comment
Share on other sites

There's another nice thing you can do with tar:

(me@local)/home/me$ tar cf - Documents/ | ssh me@server 'bzip2 >Documents.tar.bz2'

if you're on a weak machine, and have a fast network and powerfull server. Else rely more on your local machine, and do:

(me@local)/home/me$ tar czf - Documents/ | ssh me@server 'cat >Documents.tar.bz2'

 

Yves.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...