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!


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

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy