BackupPC-users

Re: [BackupPC-users] Need help with pre dump command execution on win 7 client.

2011-02-10 16:00:29
Subject: Re: [BackupPC-users] Need help with pre dump command execution on win 7 client.
From: Jeffrey Newman <jeffn AT photorepo DOT com>
To: mstowe AT chicago.us.mensa DOT org, backuppc-users AT lists.sourceforge DOT net, mstowe AT chicago.us.mensa DOT org, jeffn AT photorepo DOT com
Date: Thu, 10 Feb 2011 12:58:38 -0800
On Wednesday, February 09, 2011 10:41:12 am Michael Stowe wrote:
> > I've gone through in detail.


Hi Michael,

Thanks for the help.
I have moved over to using the code from the goodjobsucking.com site.

A the end of email is the he preusercmd.sh script, with a minor modification 
to the password. In order to get it working (from the command line) I moved 
the password to be part of the -U argument.

So, now I am able to get this work when I invoke it from the command line 
(bash shell on Linix). I can see the file.out file on the windows machine.

I made a similar modification to the postusercmd.sh script.

All the other scripts are being used verbatim. 

The invocation (from the client config) is below.

$Conf{DumpPreUserCmd} = '/home/backuppc/bin/preusercmd.sh $client';
$Conf{DumpPostUserCmd} = '/home/backuppc/bin/postusercmd.sh $client';


I invoke preusercmd from the BackupPC GUI
winexe take a 100% of a single core (17%).
I get the following line the client's log:

Output from DumpPreUserCmd: tevent: EPOLL_CTL_ADD failed (Operation not 
permitted) - falling back to select()


When I kill winexe from the process monitor I get the following in the client 
log.

2011-02-10 12:47:06 Output from DumpPreUserCmd: Aborting...
2011-02-10 12:47:18 Output from DumpPreUserCmd: 
/home/backuppc/bin/preusercmd.sh: line 7:  1432 Terminated              
$WINEXE --interactive=0 -U $UNAME%$PWD -W $WRKGRP //$BOX 'cmd /c c:
\backuppc\pre-exec.cmd'
2011-02-10 12:47:23 Output from DumpPreUserCmd: Rsync and shadow copy loaded
2011-02-10 12:47:23 incr backup started back to 2011-02-06 07:18:59 (backup 
#2) for directory cshadow
2011-02-10 12:47:38 Output from DumpPostUserCmd: Aborting...
2011-02-10 12:47:43 Output from DumpPostUserCmd: Rsync and shadow copy 
unloaded
2011-02-10 12:47:43 Got fatal error during xfer (inet connect: Connection 
refused)
2011-02-10 12:47:48 Backup aborted (inet connect: Connection refused)

I had to kill winexe 4 times, twice for the pre cmd, and twice for the post 
command.

I expect the transfer to fail because rsyncd never started.

The process monitor shows the user to be backuppc.
I have the files in the backuppc home/bin directory.

I noticed that parameters do not seem be getting substituted in the script.
What would cause this?

Any other suggestion would be very welcome.

thanks

Jeffrey




#!/bin/bash
WINEXE=/usr/local/bin/winexe
UNAME="backuppc"
PWD="MyPassWd"
WRKGRP="WORKGROUP"
BOX=$1
$WINEXE --interactive=0 -U $UNAME%$PWD -W $WRKGRP  //$BOX 'cmd /c c:
\backuppc\pre-exec.cmd'
sleep 5
echo "Rsync and shadow copy loaded"
kill $$
# The script needs to be killed, otherwise, winexe waits for input


On Wednesday, February 09, 2011 10:19:04 am Michael Stowe wrote:
> http://www.goodjobsucking.com/?p=62
> 
> There's a precmd.sh script there -- this can also be downloaded.
> 
> For reference, here it is -
> 
> #!/bin/bash
> WINEXE=/usr/bin/winexe
> UNAME="Administrator"
> PWD="password"
> WRKGRP="HOME"
> BOX=$1
> $WINEXE --interactive=0 -U $UNAME -W $WRKGRP --password=$PWD //$BOX 'cmd
> /c c:\backuppc\pre-exec.cmd' &
> pid=$!
> echo "sleep 300; kill $pid > /dev/null 2>&1" | at now
> wait $pid &> /dev/null
> while [ $? -eq 143 ]; do
>   echo "WARNING -- winexe did not complete, trying again"
>   sleep 5
>   $WINEXE --interactive=0 -U $UNAME -W $WRKGRP --password=$PWD //$BOX 'cmd
> /c c:\backuppc\pre-exec.cmd' &
>   pid=$!
>   echo "sleep 300; kill $pid > /dev/null 2>&1" | at now
>   wait $pid &> /dev/null
> done
> sleep 5
> echo "Rsync and shadow copy loaded"
> kill $$
> # That should kill us
> 
> Note that the client-side scripts are layered to avoid popping up windows
> that would interfere with anything the user is doing.
> 
> > And I've applied most of what I needed from it.
> > There is no mention about what to put the backupPC config file.
> > Or I should say, I could not find a mention of it.
> > 
> > Also, this system uses rsync not rsyncd for the transport.
> 
> I noted that, I'm just saying you can't do that and back up open files.
> 
> > Jeffrey

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
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>