batch mode maintainability

Jos Backus josb at cncdsl.com
Thu Jan 17 13:33:56 EST 2002


On Wed, Jan 16, 2002 at 02:52:08PM -0600, Dave Dykstra wrote:
> I applied the patch to the current development CVS and it gets further but
> still has trouble.  Using the above commands, the first --write-batch now
> actually copies the files in addition to creating the rsync_* files.
> However, when I mkdir d2 and run the second command replacing "d1/" with
> "d2/" it dumps core.

Something must have been broken since I sent that last patch because the
version I have here (CVS as of 12 Dec 2001) seems to work (note that my test
script is slightly different from yours):

    lizzy:~/src/rsync/batch-test% cat x
    #!/bin/sh
    PATH=../rsync-wtv:$PATH
    rm -rf s d
    rm -f rsync_*.*
    mkdir s d
    echo "rev 1" > s/f1
    echo "rev 1" > s/f2
    ls -l
    echo s:
    ls -l s
    rsync -av --write-batch s/ d/
    rsync -av --read-batch `echo rsync_argvs.*|sed 's/.*\.//'` d/
    ls -l
    echo d:
    ls -l d
    total 3
    drwxr-xr-x  2 jos  staff  512 Jan 16 18:22 d
    drwxr-xr-x  2 jos  staff  512 Jan 16 18:22 s
    -rwxr-xr-x  1 jos  staff  247 Jan 16 18:20 x
    s:
    total 2
    -rw-r--r--  1 jos  staff  6 Jan 16 18:22 f1
    -rw-r--r--  1 jos  staff  6 Jan 16 18:22 f2

    lizzy:~/src/rsync/batch-test% ./x
    batch file extension: 20020116182215
    building file list ... done
    f1
    f2
    wrote 178 bytes  read 52 bytes  460.00 bytes/sec
    total size is 12  speedup is 0.05
    wrote 12 bytes  read 20 bytes  64.00 bytes/sec
    total size is 0  speedup is 0.00
    total 7
    drwxr-xr-x  2 jos  staff  512 Jan 16 18:22 d
    -rwx------  1 jos  staff   43 Jan 16 18:22 rsync_argvs.20020116182215
    -rw-------  1 jos  staff   16 Jan 16 18:22 rsync_csums.20020116182215
    -rw-------  1 jos  staff   68 Jan 16 18:22 rsync_delta.20020116182215
    -rw-------  1 jos  staff  182 Jan 16 18:22 rsync_flist.20020116182215
    drwxr-xr-x  2 jos  staff  512 Jan 16 18:22 s
    -rwxr-xr-x  1 jos  staff  247 Jan 16 18:20 x
    d:
    total 2
    -rw-r--r--  1 jos  staff  6 Jan 16 18:22 f1
    -rw-r--r--  1 jos  staff  6 Jan 16 18:22 f2

> Keep in mind that by default on a local system rsync 2.5.0 and later
> defaults to the -W option which disables the rsync algorithm.  I thought
> that might make a difference so I also tried sending to a remote machine.
> First, I note that the rsync_argvs.* files are totally useless because they
> completely recreate the original command line, and who wants to copy to the
> exact same place twice?

Yes, except that --write-batch is replaced with --read-batch, and the first
directory name is bogus (with --read-batch one only has to specify the
_target_ directory; see the script above).

> The idea is to copy the same thing to more than one machine.  Oh, maybe the
> machine name is ignored with --read-batch?

One would think, yes.

> Nit: the rsync_argv file is missing a terminating newline.

Annoying indeed but easily fixed.

> I see that the remote side is also creating an extra rsync_argv.* file in
> the user's home directory, please stop creating those.

Hm, I don't see that behavior here.

> Copying the rsync_* files to the remote side and running a --read-batch
> command there also dumps core.
> 
> Does it work for you?

Yes, but not with the latest CVS, it cores there as well (I'm using FreeBSD,
btw). I'll try to investigate; it must be some interaction between the batch
code and some change that has been made in the last month.

> - Dave

-- 
Jos Backus                 _/  _/_/_/        Santa Clara, CA
                          _/  _/   _/
                         _/  _/_/_/             
                    _/  _/  _/    _/
josb at cncdsl.com     _/_/   _/_/_/            use Std::Disclaimer;




More information about the rsync mailing list