Thursday 12 November 2009

How to ignore hidden folders with rsync

When using rsync to copy directories, I will use the following command:

rsync -av /home/david/directory-to-copy/ /tmp/new-directory/

But to ignore hidden files (and folders) I would use the following command:

rsync -av --exclude '.*' /home/david/directory-to-copy/ /tmp/new-directory/

No comments: