Search This Blog

Monday, November 21, 2005

replicate just the directory structure

Let's say you wanted to just copy the directory structure of /opt directory to an usb drive say (/media/usb3/opt) without copying any files between these two directories. Inorder to do this

mount the usbdrive, cd into the destination directory which in this case is /media/usb3

sudo rsync -avzp --delete-after --include "*/" --exclude "*" /opt .

As usual, do not try this without knowing what it does. Use it at your own risk.

Comments/suggestions/feedback etc., are most welcome and you can reach me at (kamaraju at gmail dot com).

No comments: