I'm using
rsync . $HOST:$PATH --itemize-changes --verbose --human-readable --times --checksum --recursive --delete --delete-excluded --force --filter='dir-merge .rsync-filter'
and .rsync-filter
looks like this:
exclude .gitinstructions
exclude .gitignore
exclude .rsync-filter
exclude .gitlab-ci.yml
exclude .git
exclude timestamp.txt
exclude var
exclude LICENSE.html
exclude LICENSE.txt
exclude LICENSE_AFL.txt
exclude RELEASE_NOTES.txt
exclude config.json
protect media/**/*
Although on the remote, the media folder is being deleted:
$ rsync . $SSH_HOST:$SSH_STAGEPATH --itemize-changes --verbose --human-readable --times --checksum --recursive --delete --delete-excluded --force --filter='dir-merge .rsync-filter' sending incremental file list .d..t...... ./ *deleting media/test *deleting media/
sent 680.12K bytes received 28.00K bytes 472.08K bytes/sec total size is 139.20M speedup is 196.58
Am I missing anything? I basically want all the "excluded files/dirs" to not be uploaded, but deleted on the remote, and the "protected files/dirs" to not be uploaded and not be deleted. I was sure I am following the correct syntax from the man page.