Re: directories that change into symlinks

2003-01-06 Thread John Van Essen
Dave,

What you need is the --force option.  It's not obvious from the
all-too-generic name, but that will do the trick.

To the rsync maintainers - this is somewhat of an FAQ.  Perhaps
the error message could also say '(see the --force option)' to
help users discover the solution more easily.
-- 
John Van Essen  Univ of MN Alumnus  <[EMAIL PROTECTED]>
3DGamers  Systems Software Support  <[EMAIL PROTECTED]>


On Sun, 05 Jan 2003, David Garamond <[EMAIL PROTECTED]> wrote:

>just to correct myself: this has nothing to do with rdiff-backup (which 
>uses *rdiff*, not rsync). local backups with the rdiff-backup tool are 
>fine. the problem is with rsync, when we are trying to mirror the local 
>backups to another machine using rsync.
>
>David Garamond wrote:
>> our daily backup is done using the rdiff-backup tool, which in turn 
>> utilizes rsync/librsync to do the actual mirroring work.
>> 
>> a few days ago we did a refactoring and renamed a bunch of directories. 
>> for backward compatibility we maintain the old names by symlinking it to 
>> the new names. so, for example, oldname1/ now becomes newname1/, and 
>> oldname1 is now a symlink to newname1/.
>> 
>> we found that now the mirroring cannot complete. rsync doesn't seem to 
>> be able to handle this. it tries to do an rmdir(oldname1) followed by 
>> symlink(newname1,oldname1). however, since the directory oldname1/ in 
>> the old mirror is not empty, rmdir fails with "Directory not empty" and 
>> thus symlink fails too with "File exists" (since oldname1 has not been 
>> deleted yet).
>> 
>> any pointers? we looked at the available rsync options but have found no 
>> clue yet.
>
>-- 
>dave

-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html



Re: directories that change into symlinks

2003-01-06 Thread jw schultz
On Mon, Jan 06, 2003 at 02:05:47AM -0600, John Van Essen wrote:
> Dave,
> 
> What you need is the --force option.  It's not obvious from the
> all-too-generic name, but that will do the trick.
> 
> To the rsync maintainers - this is somewhat of an FAQ.  Perhaps
> the error message could also say '(see the --force option)' to
> help users discover the solution more easily.

The manpage in CVS has been updated to have a somewhat better
description of the --force option but it won't leap out at
you if you are looking regarding the symlink problem.

Overall the --delete, --delete-after and --force options
are a bit confusing.


> On Sun, 05 Jan 2003, David Garamond <[EMAIL PROTECTED]> wrote:
> 
> >just to correct myself: this has nothing to do with rdiff-backup (which 
> >uses *rdiff*, not rsync). local backups with the rdiff-backup tool are 
> >fine. the problem is with rsync, when we are trying to mirror the local 
> >backups to another machine using rsync.
> >
> >David Garamond wrote:
> >> our daily backup is done using the rdiff-backup tool, which in turn 
> >> utilizes rsync/librsync to do the actual mirroring work.
> >> 
> >> a few days ago we did a refactoring and renamed a bunch of directories. 
> >> for backward compatibility we maintain the old names by symlinking it to 
> >> the new names. so, for example, oldname1/ now becomes newname1/, and 
> >> oldname1 is now a symlink to newname1/.
> >> 
> >> we found that now the mirroring cannot complete. rsync doesn't seem to 
> >> be able to handle this. it tries to do an rmdir(oldname1) followed by 
> >> symlink(newname1,oldname1). however, since the directory oldname1/ in 
> >> the old mirror is not empty, rmdir fails with "Directory not empty" and 
> >> thus symlink fails too with "File exists" (since oldname1 has not been 
> >> deleted yet).
> >> 
> >> any pointers? we looked at the available rsync options but have found no 
> >> clue yet.

-- 

J.W. SchultzPegasystems Technologies
email address:  [EMAIL PROTECTED]

Remember Cernan and Schmitt
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html



Re: directories that change into symlinks

2003-01-06 Thread David Garamond
John Van Essen wrote:

Dave,

What you need is the --force option.  It's not obvious from the
all-too-generic name, but that will do the trick.

To the rsync maintainers - this is somewhat of an FAQ.  Perhaps
the error message could also say '(see the --force option)' to
help users discover the solution more easily.


thanks john, that solved the problem. i should've perhaps looked at the 
manpage twice. the manpage (2.5.5) already states this quite clearly:

 --force   force deletion of directories even if not empty

however, i personally think --force should be the default as it is more 
common, or shouldn't it?

--
dave

--
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html


Bug or feature? --delete-after + symlinks

2003-01-06 Thread J. Milgram


Hi,

sorry if this is old stuff, but I did my best to look first...

Have been getting errors along these lines:

mv mydir mdir.2002
ln -s mydir.2002 mydir

Then update mirror with rsync -av --delete-after. Without
--delete-after, no problem, with --delete-after, get a code 23.

The attached shell script will recreate the error (on my machine, at
any rate). Just run it from a clean directory.

Don't know if this is a bug or a feature. I did see the bit in the
TODO list about duplicate names and symlinks, this passage seems
relevant: "We don't need to worry about hard links causing duplicates
because files are never updated in place.  Similarly for symlinks."

For now, I'll just live without --delete-after but it would be useful
to have at some point, so grateful for any tips.

thanks!

- Judah Milgram
[EMAIL PROTECTED]


#!/bin/bash
#
# 1. rename a directory.
# 2. create symlink with old dir's name.
# 3. update mirror
#

RSYNC=/usr/bin/rsync

uname -msrp
ldd $RSYNC
$RSYNC --version

# This seems to trigger error with rsync version 2.5.5  protocol version 26
RSYNCFLAGS="-av --delete-after"

# This seems OK
# RSYNCFLAGS="-av"

# set up source directory

echo
mkdir a
mkdir a/b
touch a/b/foo
find a

# mirror to target

echo
$RSYNC $RSYNCFLAGS a a_mirror
find a a_mirror

# Now do some reorganization in source dir:

echo
cd a
mv -v b b.1
ln -sv b.1 b
cd ..

# Now mirror again: 
$RSYNC $RSYNCFLAGS a a_mirror
find a a_mirror

# end

output from above:


Linux 2.4.18 i686 unknown
libpopt.so.0 => /usr/lib/libpopt.so.0 (0x40027000)
libresolv.so.2 => /lib/libresolv.so.2 (0x4002d000)
libc.so.6 => /lib/libc.so.6 (0x4003d000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x4000)
rsync  version 2.5.5  protocol version 26
Copyright (C) 1996-2002 by Andrew Tridgell and others

Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles, 
  IPv6, 64-bit system inums, 64-bit internal inums

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

a
a/b
a/b/foo

building file list ... done
created directory a_mirror
a/b/foo
wrote 127 bytes  read 36 bytes  108.67 bytes/sec
total size is 0  speedup is 0.00
a
a/b
a/b/foo
a_mirror
a_mirror/a
a_mirror/a/b
a_mirror/a/b/foo

`b' -> `b.1'
create symbolic link `b' to `b.1'
building file list ... done
a/
delete_file: rmdir(a/b) : Directory not empty
rsync: symlink "a/b" -> "b.1": File exists
a/b.1/
a/b.1/foo
deleting a/b/foo
wrote 155 bytes  read 36 bytes  382.00 bytes/sec
total size is 3  speedup is 0.02
rsync error: partial transfer (code 23) at main.c(578)
a
a/b
a/b.1
a/b.1/foo
a_mirror
a_mirror/a
a_mirror/a/b
a_mirror/a/b.1
a_mirror/a/b.1/foo
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html



passing additional options to SSH on the rsync command line?

2003-01-06 Thread magicdb

I have an account on evilserver.
evilserver requires a *login* of the form "[EMAIL PROTECTED]".  something 
to do with cheap hosting, I suppose.

ssh gets ill on that.  ssh [EMAIL PROTECTED]@domain.com is no good.

So I do this:

ssh [EMAIL PROTECTED] domain.com

which works just fine: ssh uses the entire mess as a log in string, and 
is quite happy.

So, how can I get rsync to play ball with this ugly scheme of things?  
Is there a way?

Thanks!

PS: please cc: this address on replies, as I am not subscribed to the 
list.  thankyou very much.

--
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html


Re: passing additional options to SSH on the rsync command line?

2003-01-06 Thread jw schultz
On Mon, Jan 06, 2003 at 08:50:04PM -0700, magicdb wrote:
> 
> I have an account on evilserver.
> evilserver requires a *login* of the form "[EMAIL PROTECTED]".  something 
> to do with cheap hosting, I suppose.
> 
> ssh gets ill on that.  ssh [EMAIL PROTECTED]@domain.com is no good.
> 
> So I do this:
> 
> ssh [EMAIL PROTECTED] domain.com
> 
> which works just fine: ssh uses the entire mess as a log in string, and 
> is quite happy.
> 
> So, how can I get rsync to play ball with this ugly scheme of things?  
> Is there a way?
> 
> Thanks!
> 
> PS: please cc: this address on replies, as I am not subscribed to the 
> list.  thankyou very much.
> 

Quotes.

rsync -e "ssh [EMAIL PROTECTED]" 

-- 

J.W. SchultzPegasystems Technologies
email address:  [EMAIL PROTECTED]

Remember Cernan and Schmitt
-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html



Re: Bug or feature? --delete-after + symlinks

2003-01-06 Thread John Van Essen
On Mon, 06 Jan 2003, J. Milgram <[EMAIL PROTECTED]> wrote:

>sorry if this is old stuff, but I did my best to look first...
>
>Have been getting errors along these lines:
>
>mv mydir mdir.2002
>ln -s mydir.2002 mydir
>
>Then update mirror with rsync -av --delete-after. Without
>--delete-after, no problem, with --delete-after, get a code 23.
...
>delete_file: rmdir(a/b) : Directory not empty
>rsync: symlink "a/b" -> "b.1": File exists

[ snip ]

Hi J.,

My recent reply to someone else about deleting non-empty directories 
that have been replaced with a symlink may have the info you need:

- Forwarded message begins here -
From: John Van Essen <[EMAIL PROTECTED]>
Date: Mon, 6 Jan 2003 02:05:47 CST
Subject: Re: directories that change into symlinks

What you need is the --force option.  It's not obvious from the
all-too-generic name, but that will do the trick.

To the rsync maintainers - this is somewhat of an FAQ.  Perhaps
the error message could also say '(see the --force option)' to
help users discover the solution more easily.

-- Forwarded message ends here --

Although, I'm not sure why there are 'no problems' when you don't
use --delete-after...   It should still be trying to replace the
directory with the symlink even if no --delete* options are used,
and you should still need to use --force to get it to delete the
existing non-empty directory.
-- 
John Van Essen  Univ of MN Alumnus  <[EMAIL PROTECTED]>
3DGamers  Systems Software Support  <[EMAIL PROTECTED]>

-- 
To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html