rsync server and --delete option

Xavier xavier at www.microbsoft.com
Fri Jul 4 19:32:27 EST 2003


Ok it worked out that way, but as a matter of fact neither the --dry-run option
nor the effective action did output that it will delete those files...

I even tried to see what it would output with -vvv option and nothing.

So finally, it's working out for me, but it would be neat if it would output
something.

Thanks

Xavier

p.s. I join my test on a seperate text file.



---------- Original Message -----------
From: Wayne Davison <wayned at samba.org>
To: Xavier <xavier at www.microbsoft.com>
Sent: Thu, 3 Jul 2003 10:11:33 -0700
Subject: Re: rsync server and --delete option

> On Thu, Jul 03, 2003 at 03:23:08PM +0100, Xavier wrote:
> > rsync -nPru --delete /temp/* serverA::wwwroot/temp/
> > 
> > the delete option is not working
> 
> That's because you used a wildcard.  The --delete option only affects
> directories, and you send a list of files.  The above is equivalent to
> the following because the shell expands the wildcard:
> 
> rsync -nPru --delete /temp/foo /temp/bar /temp/baz serverA::wwwroot/temp/
> 
> So, certainly no files in wwwroot/temp are going to be deleted.  Use
> this instead:
> 
> rsync -nPru --delete /temp/ serverA::wwwroot/temp/
> 
> ..wayne..
------- End of Original Message -------

-------------- next part --------------
Here I list the content of the remote server (RSYNC server)

    user:/temp$rsync serverB::wwwroot/temp/
    drwxr-xr-x        512 2003/07/04 09:43:08 .
    -rw-r--r--    1008438 2003/07/04 09:43:07 aom_screen11.jpg
    -rw-r--r--        523 2003/07/04 09:43:07 civility.htm
    -rw-r--r--       3854 2003/07/04 09:43:07 count_down.htm
    -rw-r--r--       1314 2003/07/04 09:43:07 index.htm
    -rw-r--r--          0 2003/07/04 09:43:07 lolo
    -rw-r--r--        390 2003/07/04 09:43:08 repeat.htm
    -rw-r--r--       1318 2003/07/04 09:43:08 test.htm
    -rw-r--r--        518 2003/07/04 09:43:08 test.htm.bak
    -rw-r--r--          0 2003/07/04 09:43:08 toto

Here is the list of the local folder I want to synchronize

    user:/temp$ls -g
    total 2022
    -rw-rw-rw-   1 other    1008438 Jul  3 15:08 aom_screen11.jpg
    -rw-rw-rw-   1 other        523 Jul  3 15:08 civility.htm
    -rw-rw-rw-   1 other       3854 Jul  3 15:08 count_down.htm
    -rw-rw-rw-   1 other       1314 Jul  3 15:08 index.htm
    -rw-r--r--   1 other          0 Jul  3 15:11 lolo
    -rw-rw-rw-   1 other        390 Jul  3 15:08 repeat.htm
    -rw-rw-rw-   1 other       1318 Jul  3 15:08 test.htm
    -rw-rw-rw-   1 other        518 Jul  3 15:08 test.htm.bak
    -rw-r--r--   1 other          0 Jul  3 15:11 toto
    
I create 2 files on the serverB (ohyeah.txt, blabla.txt), then I list
the content of the folder on serverB

    user:/temp$rsync serverB::wwwroot/temp/
    drwxr-xr-x        512 2003/07/04 09:50:51 .
    -rw-r--r--    1008438 2003/07/04 09:43:07 aom_screen11.jpg
    -rw-r--r--          0 2003/07/04 09:50:43 blabla.txt
    -rw-r--r--        523 2003/07/04 09:43:07 civility.htm
    -rw-r--r--       3854 2003/07/04 09:43:07 count_down.htm
    -rw-r--r--       1314 2003/07/04 09:43:07 index.htm
    -rw-r--r--          0 2003/07/04 09:43:07 lolo
    -rw-r--r--          0 2003/07/04 09:50:51 ohyeah.txt
    -rw-r--r--        390 2003/07/04 09:43:08 repeat.htm
    -rw-r--r--       1318 2003/07/04 09:43:08 test.htm
    -rw-r--r--        518 2003/07/04 09:43:08 test.htm.bak
    -rw-r--r--          0 2003/07/04 09:43:08 toto

I try a --dry-run to check what will happend

    user:/temp$rsync -nPur --delete /temp/ serverB::wwwroot/temp/
    building file list ...
    10 files to consider
    wrote 266 bytes  read 40 bytes  612.00 bytes/sec
    total size is 1016355  speedup is 3321.42

I run rsync and get no output at all

    user:/temp$rsync -Pur --delete /temp/ serverB::wwwroot/temp/

I list again the directory and the files are gone

    user:/temp$rsync serverB::wwwroot/temp/
    drwxr-xr-x        512 2003/07/04 09:51:23 .
    -rw-r--r--    1008438 2003/07/04 09:43:07 aom_screen11.jpg
    -rw-r--r--        523 2003/07/04 09:43:07 civility.htm
    -rw-r--r--       3854 2003/07/04 09:43:07 count_down.htm
    -rw-r--r--       1314 2003/07/04 09:43:07 index.htm
    -rw-r--r--          0 2003/07/04 09:43:07 lolo
    -rw-r--r--        390 2003/07/04 09:43:08 repeat.htm
    -rw-r--r--       1318 2003/07/04 09:43:08 test.htm
    -rw-r--r--        518 2003/07/04 09:43:08 test.htm.bak
    -rw-r--r--          0 2003/07/04 09:43:08 toto
    
I recreated the files again on serverB and ran the rsync with -vvv option

    user:/temp$rsync -Purvvv --delete /temp/ serverB::wwwroot/temp/
    opening tcp connection to serverB port 873
    building file list ...
    make_file(4,.)
    expand file_list to 4000 bytes, did move
    make_file(4,aom_screen11.jpg)
    make_file(4,civility.htm)
    make_file(4,test.htm)
    make_file(4,repeat.htm)
    make_file(4,index.htm)
    make_file(4,test.htm.bak)
    make_file(4,count_down.htm)
    make_file(4,toto)
    make_file(4,lolo)
    10 files to consider
    send_file_list done
    send_files starting
    send_files phase=1
    send files finished
    total: matches=0  tag_hits=0  false_alarms=0 data=0
    wrote 267 bytes  read 40 bytes  614.00 bytes/sec
    total size is 1016355  speedup is 3310.60
    _exit_cleanup(code=0, file=main.c, line=620): about to call exit(0)
    
The files are gone again, but no log is available

    user:/temp$rsync serverB::wwwroot/temp/
    drwxr-xr-x        512 2003/07/04 10:00:51 .
    -rw-r--r--    1008438 2003/07/04 09:43:07 aom_screen11.jpg
    -rw-r--r--        523 2003/07/04 09:43:07 civility.htm
    -rw-r--r--       3854 2003/07/04 09:43:07 count_down.htm
    -rw-r--r--       1314 2003/07/04 09:43:07 index.htm
    -rw-r--r--          0 2003/07/04 09:43:07 lolo
    -rw-r--r--        390 2003/07/04 09:43:08 repeat.htm
    -rw-r--r--       1318 2003/07/04 09:43:08 test.htm
    -rw-r--r--        518 2003/07/04 09:43:08 test.htm.bak
    -rw-r--r--          0 2003/07/04 09:43:08 toto


More information about the rsync mailing list