Hi I just started to use rsync & samba to backup some windows NT & 98 shared directories to a linux machine linux: debian 2.2.4 rsync: 2.2.5 samba: 2.2.3a-6 I first mount the windows directory on the linux and then do a local rsync. ---command on linux umount /data/transfer mount -t smbfs -o username=user,password=passwd //ntserver/exp_dir /data/transfer cd /data/transfer rsync -a --delete * /data/exp_dir umount /data/transfer --- this works fine, except for deleted files. Files that got deleted on the windows remain on the linux side, even after repeated rsync's This is what the --delete option is supposed to do. I've tested this several times. the samba mount show the correct state, i.e. without the deleted files. Rsync does not notice they're gone. I've seen/read a lot of posts in the google archives concerning this --delete option. Most of them came from this mailing list. They all seem to suggest it really should work. So, what did I do wrong? best regards glenn -- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Save up to $160 by signing up for NetZero Platinum Internet service. http://www.netzero.net/?refcd=N2P0602NEP8
Try adding -v to your rsync command to get more verbose output, perhaps giving you an idea why --delete is not working as expected. --delete works for me, but there are situations where rsync will ignore --delete for safety (such as if certain errors occur). Also, remember that "*" is expanded by your shell, before rsync sees the command line. So if your /data/transfer contained files "a", "b", "c", and "d", and you deleted "c", rsync would see your command line as: rsync -a --delete a b d /data/exp_dir In other words, you've told rsync not to sync "c", so it would have no reason to delete it at the destination directory. Try using "." instead of "*" to get more reliable results. Doug -----Original Message----- From: g dm [mailto:gdm2002@email.com] Sent: Tuesday, July 23, 2002 11:55 AM To: rsync@lists.samba.org Subject: Rsync --delete does not work Hi I just started to use rsync & samba to backup some windows NT & 98 shared directories to a linux machine linux: debian 2.2.4 rsync: 2.2.5 samba: 2.2.3a-6 I first mount the windows directory on the linux and then do a local rsync. ---command on linux umount /data/transfer mount -t smbfs -o username=user,password=passwd //ntserver/exp_dir /data/transfer cd /data/transfer rsync -a --delete * /data/exp_dir umount /data/transfer --- this works fine, except for deleted files. Files that got deleted on the windows remain on the linux side, even after repeated rsync's This is what the --delete option is supposed to do. I've tested this several times. the samba mount show the correct state, i.e. without the deleted files. Rsync does not notice they're gone. I've seen/read a lot of posts in the google archives concerning this --delete option. Most of them came from this mailing list. They all seem to suggest it really should work. So, what did I do wrong? best regards glenn -- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Save up to $160 by signing up for NetZero Platinum Internet service. http://www.netzero.net/?refcd=N2P0602NEP8 -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html
On Tue, 23 Jul 2002, g dm wrote:> rsync -a --delete * /data/exp_dir > So, what did I do wrong?You're sending a list of files, not a directory (since '*' is expanded by the shell into a list of files). The --delete option only works on a directory-to-directory transfer, so try using this instead: rsync -a --delete ./ /data/exp_dir ..wayne..
----- Original Message ----- From: Wayne Davison <wayned@users.sourceforge.net> Date: Tue, 23 Jul 2002 13:25:54 -0700 (PDT) To: g dm <gdm2002@email.com> Subject: Re: Rsync --delete does not work> On Tue, 23 Jul 2002, g dm wrote: > > rsync -a --delete * /data/exp_dir > > So, what did I do wrong? > > You're sending a list of files, not a directory (since '*' is expanded > by the shell into a list of files). The --delete option only works on > a directory-to-directory transfer, so try using this instead: > > rsync -a --delete ./ /data/exp_dir > > ..wayne.. > >-- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Save up to $160 by signing up for NetZero Platinum Internet service. http://www.netzero.net/?refcd=N2P0602NEP8
thank you for the help, Wayne & Doug. It works now. it was indeed the shell expansion I didn't correctly understand It's indeed the first time I come across the ./ parameter Bye Glenn ----- Original Message ----- From: Wayne Davison <wayned@users.sourceforge.net> Date: Tue, 23 Jul 2002 13:25:54 -0700 (PDT) To: g dm <gdm2002@email.com> Subject: Re: Rsync --delete does not work> On Tue, 23 Jul 2002, g dm wrote: > > rsync -a --delete * /data/exp_dir > > So, what did I do wrong? > > You're sending a list of files, not a directory (since '*' is expanded > by the shell into a list of files). The --delete option only works on > a directory-to-directory transfer, so try using this instead: > > rsync -a --delete ./ /data/exp_dir > > ..wayne.. > >-- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup Save up to $160 by signing up for NetZero Platinum Internet service. http://www.netzero.net/?refcd=N2P0602NEP8