RE: transfer interrupted, and Not privileged errors,

2000-11-09 Thread Todd Robinson

Yep, thanks, and thanks to the others who pointed it out off list too.  I
remember learning this some time ago, but excuses I wasn't really even
thinking about that problem, dog burned down, house ran away, I've got a
cold, going to be 40 in another month and my medium term memory is obviously
shot /excuses.

Oh well, on to the fun stuff that I still remember how to fix...


Todd

 -Original Message-
 From: Martin Pool [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 08, 2000 8:28 PM
 To: Todd Robinson
 Cc: [EMAIL PROTECTED]
 Subject: Re: transfer interrupted, and Not privileged errors,


 On  8 Nov 2000, Todd Robinson [EMAIL PROTECTED] wrote:
   That's pretty strange, for two reasons: as far as I knew, everything
   ought to go to stderr, stdout, or the log file.  When you say
   "console", do you mean it comes out in your current window, or it goes
   to the actual VGA adapter/serial console of the server?
 
  In the current window the rsync was executed from, even if you redirect
  stderr someplace else.  For instance, I run something just like this:
 
rsync -avvvz /tmp/rsync-2.4.6/lib fdops3::marktg 21 
 /rsync.txt

 Ah, OK.  This is because stderr is not actually redirected!

 The construct 21 means ``send fd2 (stderr) to wherever fd1 (stdout)
 is pointing *at the moment*''.  Since redirections are evaluated in
 order left-to-right, this sends stderr to the terminal (probably where
 it was already going), and then sends stdout to the file.  From the
 bash man page:

Note that the order of redirections is  significant.   For
example, the command

   ls  dirlist 21

directs  both  standard  output  and standard error to the
file dirlist, while the command

   ls 21  dirlist

directs only the standard output to file dirlist,  because
the  standard  error  was  duplicated  as  standard output
before the standard output was redirected to dirlist.

 I still remember the `ah-ha!' moment when this sunk in a few years
 ago.

 Regards,
 --
 Martin Pool, Linuxcare, Inc.
 +61 2 6262 8990
 [EMAIL PROTECTED], http://www.linuxcare.com/
 Linuxcare. Support for the revolution.






Update to the configuration question:

2000-11-09 Thread Tyler Hardison

Ok I'd like to thank everyone for their help on this and here is what I came
up with. (thanks to Kristian Hoffman at PC-Intouch) Before RSYNC runs, I use
rsh (with the mirrored server as a trusted host) to run the following
command on server 1 `mount | grep raid | awk '{print $1}' | sed -e 's/\///'`
from which the output is placed into a scalar named RAIDLIST. The output is
consistent with the "keys" I have defined in rsyncd.conf I then run that
list through a foreach loop syncing each of the "mounted" raids. If a raid
is unmounted (for whatever reason) then it is not synced.

Again thanks everyone, if someone else uses this let me know how it works
out for you.

Tyler.





Re: [Cvale] Update to the configuration question:

2000-11-09 Thread Tyler Hardison

Here is the requested script for those who are interested:


{rsync.sh}
#!/bin/sh
#This script will sync Jobserver 1 to Jobserver 2. This script is "safe" and
wor
ks great. I am adding some other rsyncd.conf
#volumes to help with printer syncing.

LIST=`rsh -l rsync 192.168.40.4 /sbin/getraid.sh`
#LIST="raid00 raid01 raid02 raid03 raid04 raid05 raid06 raid07 raid08 raid09
rai
d10 raid11 raid12 raid14 raid15 raidacct"
echo $LIST

echo `date`

for d in $LIST; do
   echo "Syncing files from $d"
   #rm -rf /$d/*
   /usr/local/bin/rsync -qa --delete --exclude=tmp --exclude=Network\ Trash\
Fo
lder 192.168.40.4::$d /$d/
done

echo "Syncing files from /usr/lib/lp"

/usr/local/bin/rsync -qa --delete 192.168.40.4::lp /usr/lib/lp/.

echo `date`
{end}

This one resides on the master server:

{/getraid.sh}
#!/bin/sh
raidlist=`/sbin/mount | grep raid | awk '{print $1}' | sed -e 's/\///'`
echo $raidlist
{end}