Rsync deleting files from destination directory
Hi all, I'm new here so I'm sorry if I posted this in the wrong place, but I was hoping someone might be able to help me out with this problem we've been having with rsync.
We have an rsync cron job set up to mirror all the files in a "..\das\htdocs\docs" folder to the same folder on another server. It copies all the files over correctly and deletes any files in the "docs" directory that aren't in the sending directory, but it also deletes any files we put in the target directory's parent folder (..\das\htdocs\ or other subfolders like ..\das\htdocs\images) even though they've been excluded in the .rsync-filter file.
Here's our current rsync .sh:
/usr/local/bin/rsync --stats -qPzrtpl --delete --password-file=/var/run/.appprodrsync --log-file=/export/home
/webuser/logs/rsync-extranet-log -FF /export/home/ appprodrsync@appprod::dprweb_extranet/ > /export/home/webuser/logs/rsync-extranet-output 2>&1
Here's the filter rules we're using:
So for example server A has ..\das\htdocs\docs and ..\das\htdocs\images. Server B has ..\das\htdocs\docs but if I manually copy the images folder over to ..\das\htdocs\images, the images folder gets deleted from the target directory every time rsync runs.
..\das\htdocs\images (<-- gets deleted everytime rsync runs)
I'd like to keep just the docs directory synched and update other folders manually, but they keep getting deleted. It looks to me like it's running a delete-excluded option, but that option wasn't used.
Any idea what I'm doing wrong and how I can fix it?
read the man page
I did read the man page. But it's deleting files that are excluded. My understanding was that if a directory was excluded it would not delete those files unless the delete-exclude option was used.
EDIT: Specifically the --delete option is used to keep extraneous files out of the "docs" directory, not delete files and folders outside the docs directory.
|All times are GMT -5. The time now is 03:44 PM.|