Exclude selective folders with identical names in Rsync run/var/www/html/wordpress/wp-admin/uploads – (exclude) /var/www/html/wordpress/wp-content/uploads – (sync)

We recently had to run rsync excluding some identically named folders.

To explain:

/var/www/html/cms/admin/uploads - (exclude)

/var/www/html/cms/content/uploads - (sync)

Here is how we got around to getting this done

rsync -av --exclude=/admin/uploads/ /var/www/html/cms/ /var/www/html/syncfolder/ --progress


-a: Archive mode

-v: increase verbosity

–exclude: exclude files matching PATTERN


Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.