0

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=192.168.0.2,rw,lfs,dir_mode=0777,file_mode=0777 //192.168.0.2/test /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!

1 Answer 1

1

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

1
  • 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, 2010 at 9:43

You must log in to answer this question.