Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I have 2 machines, one running MS Windows SBS 2003 and the other ubuntu 10.04 server.

I have a backup system in place already on the windows machine for a data folder. (D:\test )

I recently had to move that folder to the linux server ( /data1/test ) and now I want to still back up that folder.

So I though I would simply rsync that folder on linux to the windows one, and leave the backup process the same as it was.

So, I'm using samba to mount the windows drive : mount -t cifs -o username=xxx,password=xxx,netbiosname=hostname,ip=,rw,lfs,dir_mode=0777,file_mode=0777 // /server/test

and then the rsync : rsync -rzhvv --delete-after --stats --progress /test/* /server/test/ --log-file=/crons/test.log

My problem is that firstly it's not deleting files properly... and it's not copying .htaccess files over.

e.g. on the linux machine I work on /test/ .. I created : 1 2 .htaccess

I run rsync, and I see this on windows : 1 2

I delete "2" from windows, run rsync, and it restores the file.

I delete "2" from linux, run rsync, and it doesn't delete from windows.

any help will be greatly appreciated!

share|improve this question

For the hidden files a change of syntax should fix your problems, just remove the * from the end of your source, the trailing slash already indicates to grab the contents of the directory rather than the directory itself:

rsync -rzhvv --delete-after --stats --progress /test/ /server/test/ --log-file=/crons/test.log

share|improve this answer
Awesome! perfect. thanks.. – user59279 Nov 5 '10 at 9:42
I'm running it again now, to see if that doesn't also fix the syncing problem.... it takes a while to run because I'm running it on the real folder now that's 120 GB and 180 000 files – user59279 Nov 5 '10 at 9:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.