BackupPC-users

Re: [BackupPC-users] DumpPreUserCmd status returns

2009-11-27 09:42:59
Subject: Re: [BackupPC-users] DumpPreUserCmd status returns
From: Tino Schwarze <backuppc.lists AT tisc DOT de>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Fri, 27 Nov 2009 15:40:56 +0100
On Fri, Nov 27, 2009 at 09:26:26AM -0500, Jeffrey J. Kosowsky wrote:

>  > > As many know, I use rsync in DumpPreUserCmd to run my shadowmountrsync
>  > > routine on the remote client. This routine has many legitimate reasons
>  > > for not returning success.
>  > > 
>  > > However, the backuppc log often shows on failure:
>  > >                  2009-11-24 11:00:04 DumpPreUserCmd returned error 
> status 512... exiting
>  > > 
>  > > I don't understand the 512 status since the rsync man pages lists
>  > > return codes as 0-35. So what does 512 mean?
>  > 
>  > It's 256 * exitStatus, so the exit status is 2.  The lower 8 bits are
>  > the signal number, if any, that killed the process.
> 
> Thanks Craig...
> 
> So, I guess if I want to return the exit code of the remote process I
> am running (shadowmountrsync) then I should have shadowmountrsync
> write the exit code to stdout. Then capture that as the output of the
> remote rsync command and return it.
 
I'm not familiar with how you call the script, but ssh does pass back
the exit codes:

> ssh $server /bin/true && echo jo
jo
> ssh $server /bin/false && echo jo
>

And if you're concerned about your remote script catching some exit
code, it works like this:

$somecommand
saved_exitcode=$?
...
exit $saved_exitcode

Maybe you're talking about Windows - there should be a way as well to
catch the exit code of the last command.

> Which brings to mind a suggestion...
> Why not execute these commands in a shell.
> They are not run that frequently (once per day per host) so the
> overhead of launching a shell would be low while the benefit would be
> high in terms of flexibility.

Then you open the "how to escape things correctly when passing them to a
shell" box.

HTH,

Tino.

-- 
"What we nourish flourishes." - "Was wir nähren erblüht."

www.lichtkreis-chemnitz.de
www.tisc.de

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

<Prev in Thread] Current Thread [Next in Thread>