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