Re: Shell Script Does not complete if rsync returns Code 24

2006-01-11 Thread René Rebe
Hi,

On Wednesday 11 January 2006 04:28, John Gallagher wrote:

 The problem is that I have no clue what to do with this and or how to make
 it work with my script.

If you want hide errors, remove the -e from your sh invocation or add || true
at the end of the rsync invocation.

Though I would not do either in a backup script. Better would be to just ignore
some of rsync's return codes.

Regards,

-- 
René Rebe - Rubensstr. 64 - 12157 Berlin (Europe / Germany)
http://www.exactcode.de | http://www.t2-project.org
+49 (0)30  255 897 45
--
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: performance with 50GB files

2006-01-11 Thread René Rebe
Hi,

On Wednesday 11 January 2006 00:31, Wayne Davison wrote:

 So, perhaps the size of the sending file should be factored into the
 calculation in order to set a minimum acceptable block size.  This would
 be easy, because the generator already knows the size of both files at
 the time that it performs this calculation (or else it wouldn't have
 been able to figure out if the file was up-to-date or not).

So, here is some hackery to scale the block size from 700 bytes for a near
zero sized file to 5MB for a 50GB file and linear increasing using the bigger 
size
of the the two available sources.

But I fear you want to keep something like the old, rather overly complex IMHO
block size algorithm but tweak some factor in it ...

--- rsync-2.6.6/generator.c 2005-07-28 21:06:03.0 +0200
+++ rsync-2.6.6-fixed/generator.c   2006-01-11 12:34:01.0 +0100
@@ -405,25 +405,11 @@
 
if (block_size)
blength = block_size;
-   else if (len = BLOCK_SIZE * BLOCK_SIZE)
-   blength = BLOCK_SIZE;
else {
-   int32 c;
-   int64 l;
-   int cnt;
-   for (c = 1, l = len, cnt = 0; l = 2; c = 1, cnt++) {}
-   if (cnt = 31 || c = MAX_BLOCK_SIZE)
+   blength = len / 1 + BLOCK_SIZE;
+   blength -= blength % 8; /* round to multiple of 8 */
+   if (blength = MAX_BLOCK_SIZE)
blength = MAX_BLOCK_SIZE;
-   else {
-   blength = 0;
-   do {
-   blength |= c;
-   if (len  (int64)blength * blength)
-   blength = ~c;
-   c = 1;
-   } while (c = 8);   /* round to multiple of 8 */
-   blength = MAX(blength, BLOCK_SIZE);
-   }
}
 
if (protocol_version  27) {
@@ -462,14 +448,14 @@
  *
  * Generate approximately one checksum every block_len bytes.
  */
-static void generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
+static void generate_and_send_sums(int fd, OFF_T len, OFF_T len2, int f_out, 
int f_copy)
 {
int32 i;
struct map_struct *mapbuf;
struct sum_struct sum;
OFF_T offset = 0;
 
-   sum_sizes_sqroot(sum, len);
+   sum_sizes_sqroot(sum, MAX(len, len2));
 
if (len  0)
mapbuf = map_file(fd, len, MAX_MAP_SIZE, sum.blength);
@@ -1123,7 +1109,7 @@
return;
}
 
-   generate_and_send_sums(fd, st.st_size, f_out, f_copy);
+   generate_and_send_sums(fd, st.st_size, file-length, f_out, f_copy);
 
if (f_copy = 0) {
close(f_copy);


-- 
René Rebe - Rubensstr. 64 - 12157 Berlin (Europe / Germany)
http://www.exactcode.de | http://www.t2-project.org
+49 (0)30  255 897 45
--
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Shell Script Does not complete if rsync returns Code 24

2006-01-11 Thread Linus Hicks

René Rebe wrote:

Hi,

On Wednesday 11 January 2006 04:28, John Gallagher wrote:



The problem is that I have no clue what to do with this and or how to make
it work with my script.



If you want hide errors, remove the -e from your sh invocation or add || true
at the end of the rsync invocation.

Though I would not do either in a backup script. Better would be to just ignore
some of rsync's return codes.


It seems to me you are getting what you are asking for. From the sh manpage:

   -e  Exit immediately if a simple command (see SHELL GRAMMAR above) exits
   with a non-zero status.  The shell does not exit if the command that
   fails  is  part of the command list immediately following a while or
   until keyword, part of the test in an if statement, part of a   or
   ||  list,  or if the command's return value is being inverted via !.
   A trap on ERR, if set, is executed before the shell exits.

If you want to handle errors from rsync in your shell script, then remove the 
-e and test for errors after your call to rsync.


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


RE: Shell Script Does not complete if rsync returns Code 24

2006-01-11 Thread John Gallagher
 If you want to handle errors from rsync in your shell script, 
 then remove the -e and test for errors after your call to rsync.
 
 Linus

Let me start by saying my shell scripting skills are very weak, as if that
were not already apparent.

I understand the -e will exit when the return code is other than 0.  I
believe this is what I want with the exception of the rsync code 24 files
have vanished error.  The script is a modified version of one of the
examples found on http://www.mikerubel.org/computers/rsync_snapshots/.  It
takes almost 3 hours to complete the index of the directory, sync and then
removal of the oldest backup (Snapshot).  

Are you saying that in order to use the wrapper example below I need to
remove the -e?  How do I call the wrapper or do I need to incorporate this
example into the original script?  This is where I am clueless.

From: http://samba.anu.edu.au/rsync/FAQ.html
The easiest way to do this is to create a shell script wrapper. For
instance, name this something like rsync-no24: 

#!/bin/sh
rsync $@
e=$?
if test $e = 24; then
exit 0
fi
exit $e


Thanks,

John

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


Re: Shell Script Does not complete if rsync returns Code 24

2006-01-11 Thread Wayne Davison
On Tue, Jan 10, 2006 at 07:28:00PM -0800, John Gallagher wrote:
 The problem is that I have no clue what to do with this and or how to
 make it work with my script.

The FAQ says to name the script something like rsync-no24.  All you'd
need to do in your script is to run rsync-no24 in place of rsync.

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


Re: Can I disable socket, only enable ssh tunnel ?

2006-01-11 Thread Wayne Davison
On Wed, Jan 11, 2006 at 12:42:10AM +0800, Cauchy Song wrote:
 Can I disable socket, only enable ssh tunnel ?

(Your question is very cryptic, so I am left to guess what it means.)

If you have an rsync daemon running on a machine, try changing the
rsyncd.conf file to make it only allow connections from localhost:

hosts allow = 127.0.0.0/24

That will ensure that it can accept a tunneled connection from another
machine, but not a direct connection from another machine.

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


Re: Shell Script Does not complete if rsync returns Code 24

2006-01-11 Thread Linus Hicks

John Gallagher wrote:
If you want to handle errors from rsync in your shell script, 
then remove the -e and test for errors after your call to rsync.


Linus



Let me start by saying my shell scripting skills are very weak, as if that
were not already apparent.

I understand the -e will exit when the return code is other than 0.  I
believe this is what I want with the exception of the rsync code 24 files
have vanished error.  The script is a modified version of one of the
examples found on http://www.mikerubel.org/computers/rsync_snapshots/.  It
takes almost 3 hours to complete the index of the directory, sync and then
removal of the oldest backup (Snapshot).  


Are you saying that in order to use the wrapper example below I need to
remove the -e?  How do I call the wrapper or do I need to incorporate this
example into the original script?  This is where I am clueless.

From: http://samba.anu.edu.au/rsync/FAQ.html
The easiest way to do this is to create a shell script wrapper. For
instance, name this something like rsync-no24: 


#!/bin/sh
rsync $@
e=$?
if test $e = 24; then
exit 0
fi
exit $e


First, this is not an rsync issue.

You made this statement in your original post:

quote
Any command after the rsync never gets executed if I get the above error.
The file system is very large and we have engineers working at all hours so
it is rare that this would complete with out the code 24 error.
/quote

That tells me that you want your script (the one you posted in your original 
message) to continue processing if rsync takes the error 24. If that is the 
case, then you need to remove the -e on your shell invocation OR call a wrapper 
that treats the error 24 as normal. Since you seem to be going in the wrapper 
direction, leave the -e on you shell invocation (so other errors will cause the 
script to exit immediately) and modify this line:


RSYNC=/usr/bin/rsync

with the path of your wrapper that ignores the error 24. For example:

RSYNC=/usr/local/bin/rsync-no24

Your wrapper shell script will notice that rsync got an error 24, and return an 
exit status of zero so your main shell script will think everything is fine.


Linus

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


RE: Shell Script Does not complete if rsync returns Code 24

2006-01-11 Thread John Gallagher
 
 First, this is not an rsync issue.
 
 That tells me that you want your script (the one you posted 
 in your original
 message) to continue processing if rsync takes the error 24. 
 If that is the case, then you need to remove the -e on your 
 shell invocation OR call a wrapper that treats the error 24 
 as normal. Since you seem to be going in the wrapper 
 direction, leave the -e on you shell invocation (so other 
 errors will cause the script to exit immediately) and modify 
 this line:
 
 RSYNC=/usr/bin/rsync
 
 with the path of your wrapper that ignores the error 24. For example:
 
 RSYNC=/usr/local/bin/rsync-no24
 
 Your wrapper shell script will notice that rsync got an error 
 24, and return an exit status of zero so your main shell 
 script will think everything is fine.
 
 Linus

You are correct this is not a rsync issue, however the FAQ is posted on how
to filter out the Code 24 error.  What was not clear to me was how to call
the no24 wrapper.

It is very clear now and I have modified the script based on your
recommendations. 

Thank you!

John

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


2.6.2 rsync --daemon is not working for me

2006-01-11 Thread chitra.vaidyanathan




Can anyone explain
to me how strace works? I mean does it need to modify the system calls iternally
for some kind of event notification. 
Can it not be used
for monitoring a process non-intrusively?

Thanks
Chitra


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html