سؤال

When pushing to the server from our local machines, we'd like to exclude (or not overwrite) directories used by awstats.

Is it possible to get rsync to replace everything on the server but ignore two symbolic links and a directory?

awstats-icon -> icon
awstatsicons -> icon
/icon

Our current rsync call looks like this where we're excluding .git from our local machines:

rsync -vzrP --delete --exclude '.git' ~/Sites/path/to/sitename/ user@server.com:/path/to/sitename/

Any pointers in the right direction would be much appreciated.

هل كانت مفيدة؟

المحلول

Would it work for you to also exclude the symbolic links and the directory?

rsync -vzrP --delete --exclude '.git' --exclude 'awstats-icon' --exclude 'awstatsicons' --exclude 'icon' ~/Sites/path/to/sitename/ user@server.com:/path/to/sitename/

This would prevent pushing the symbolic links and directory, while preserving (not deleting) the remote symbolic links or directories with the same names.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top