Saturday, October 20, 2007

Duplicate a directory structure, using rsync.

You can duplicate a directory structure without duplicate the contents of these directories using 'rsync'.

$ rsync -avz --include='*/' --exclude='*' SOURCEDIR DESTDIR


Obviously login as root in the remote computer is a requirement whether you want to preserve the ownership.

Note: When I copy files to a remote computer I'm not capable of preserve the ownership of the files using this rsync options in spite of the rsync man says that.

0 comments: