|
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:
+ /das
+ /em
+ /enf
- /*
+ /*/htdocs
- /*/*
+ /*/htdocs/docs
- /*/htdocs/*
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.
A: ..\das\htdocs\docs
..\das\htdocs\images
B: ..\das\htdocs\docs\
..\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?
Thanks
- Russell
|