SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
post user command
Author Message
Post post user command 
Hello...

I was just after some information regarding $Conf{DumpPostUserCmd} variable - When this is set, is it true that while this other external command is running, that BackupPC also still shows up in the cgi interface that it's still backing up?

I am running a command after it's finished ('/usr/bin/sudo /bin/sh /usr/local/scripts/scan-host.sh $host $type $xferOK') which scans for viruses of that host. Then after that is finished, it passes those variables to a perl script which mails the status to me (weather it was successful, plus virus summery information). But I've noticed that the the backup has finished as it's started to run the scan-host.sh script but BackupPC is reporting that it's still backing up the host (and I know it's not, as there is no bandwidth being chewed up). In the LOG file, it doesn't say that it has finished either.

Is this just normal? And if so, how can I get BackupPC to stop after it's finished backing up but continue to run the post command? Normally I wouldn't care but sometimes scanning for viruses can take a fair while, and if I was to stop it, I guess BackupPC would think this has failed and would then remove the 'new' directory and all the files in it that it creates when starting a new backup...

Post post user command 
Ben writes:

I was just after some information regarding $Conf{DumpPostUserCmd}
variable - When this is set, is it true that while this other external
command is running, that BackupPC also still shows up in the cgi
interface that it's still backing up?

I am running a command after it's finished ('/usr/bin/sudo /bin/sh
/usr/local/scripts/scan-host.sh $host $type $xferOK') which scans for
viruses of that host. Then after that is finished, it passes those
variables to a perl script which mails the status to me (weather it was
successful, plus virus summery information). But I've noticed that the
the backup has finished as it's started to run the scan-host.sh script
but BackupPC is reporting that it's still backing up the host (and I
know it's not, as there is no bandwidth being chewed up). In the LOG
file, it doesn't say that it has finished either.

$Conf{DumpPostUserCmd} is run by BackupPC_dump after the Xfer
is finished, but before the backup is renamed and BackupPC
itself is told that it is done. Therefore it appears just
like you describe: while $Conf{DumpPostUserCmd} runs, BackupPC
will still show that the backup is running.

Is this just normal? And if so, how can I get BackupPC to stop after
it's finished backing up but continue to run the post command? Normally
I wouldn't care but sometimes scanning for viruses can take a fair
while, and if I was to stop it, I guess BackupPC would think this has
failed and would then remove the 'new' directory and all the files in it
that it creates when starting a new backup...

How about you background the script in $Conf{DumpPostUserCmd}?
However, BackupPC doesn't use a shell to run $Conf{DumpPostUserCmd},
so you can't just put an "&" at the end. But your script scan-host.sh
could background most of its work, then $Conf{DumpPostUserCmd} will
complete quickly and allow BackupPC_dump to finish up.

Craig


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post post user command 
Thanks! I'll give it a go.

On Wed, 2004-03-10 at 22:36, Craig Barratt wrote: Ben writes:

I was just after some information regarding $Conf{DumpPostUserCmd}
variable - When this is set, is it true that while this other external
command is running, that BackupPC also still shows up in the cgi
interface that it's still backing up?

I am running a command after it's finished ('/usr/bin/sudo /bin/sh
/usr/local/scripts/scan-host.sh $host $type $xferOK') which scans for
viruses of that host. Then after that is finished, it passes those
variables to a perl script which mails the status to me (weather it was
successful, plus virus summery information). But I've noticed that the
the backup has finished as it's started to run the scan-host.sh script
but BackupPC is reporting that it's still backing up the host (and I
know it's not, as there is no bandwidth being chewed up). In the LOG
file, it doesn't say that it has finished either.

$Conf{DumpPostUserCmd} is run by BackupPC_dump after the Xfer
is finished, but before the backup is renamed and BackupPC
itself is told that it is done. Therefore it appears just
like you describe: while $Conf{DumpPostUserCmd} runs, BackupPC
will still show that the backup is running.

Is this just normal? And if so, how can I get BackupPC to stop after
it's finished backing up but continue to run the post command? Normally
I wouldn't care but sometimes scanning for viruses can take a fair
while, and if I was to stop it, I guess BackupPC would think this has
failed and would then remove the 'new' directory and all the files in it
that it creates when starting a new backup...

How about you background the script in $Conf{DumpPostUserCmd}?
However, BackupPC doesn't use a shell to run $Conf{DumpPostUserCmd},
so you can't just put an "&" at the end. But your script scan-host.sh
could background most of its work, then $Conf{DumpPostUserCmd} will
complete quickly and allow BackupPC_dump to finish up.

Craig


Post post user command 
Hey gday, I finally got around to trying this... But it doesn't seem to =
be working properly. This the $Conf{DumpPostUserCmd} variable:

$Conf{DumpPostUserCmd} =3D '/usr/bin/sudo /bin/sh =
/usr/local/scripts/pass-values.sh $host $xferOK';

and in pass-values.sh, I have the following:

#!/bin/bash

## Few comments...

HOST=3D$1
XFER=3D$2

if [ $XFER =3D=3D 1 ]=20
then
/usr/local/scripts/scan-host.sh $HOST $XFER &
else
/usr/local/scripts/mail-backup.pl $HOST $XFER &
fi =20
sleep 5

(I have a sleep there so the scan-host.sh script scans the "new" =
directory before BackupPC_dump renames new to a number...)

Anyway, it still seems to be waiting for scan-host.sh to finish.

Also, is there a way to tell which file BackupPC is currently backing =
up? One of our hosts failed last night with ALM signal, possibly timeout =
issue, not sure, could be something else, just was wondering if there =
was a way thats all.

Thanks.

-----Original Message-----
From: Craig Barratt [mailto:cbarratt < at > users.sourceforge.net]
Sent: Wed 3/10/2004 10:36 PM
To: Ben Zampatti
Cc: backuppc-users < at > lists.sourceforge.net
Subject: Re: [BackupPC-users] post user command=20
=20
Ben writes:

I was just after some information regarding $Conf{DumpPostUserCmd}
variable - When this is set, is it true that while this other external
command is running, that BackupPC also still shows up in the cgi
interface that it's still backing up?
=20
I am running a command after it's finished ('/usr/bin/sudo /bin/sh
/usr/local/scripts/scan-host.sh $host $type $xferOK') which scans for
viruses of that host. Then after that is finished, it passes those
variables to a perl script which mails the status to me (weather it =
was
successful, plus virus summery information). But I've noticed that the
the backup has finished as it's started to run the scan-host.sh script
but BackupPC is reporting that it's still backing up the host (and I
know it's not, as there is no bandwidth being chewed up). In the LOG
file, it doesn't say that it has finished either.=20

$Conf{DumpPostUserCmd} is run by BackupPC_dump after the Xfer
is finished, but before the backup is renamed and BackupPC
itself is told that it is done. Therefore it appears just
like you describe: while $Conf{DumpPostUserCmd} runs, BackupPC
will still show that the backup is running.

Is this just normal? And if so, how can I get BackupPC to stop after
it's finished backing up but continue to run the post command? =
Normally
I wouldn't care but sometimes scanning for viruses can take a fair
while, and if I was to stop it, I guess BackupPC would think this has
failed and would then remove the 'new' directory and all the files in =
it
that it creates when starting a new backup...

How about you background the script in $Conf{DumpPostUserCmd}?
However, BackupPC doesn't use a shell to run $Conf{DumpPostUserCmd},
so you can't just put an "&" at the end. But your script scan-host.sh
could background most of its work, then $Conf{DumpPostUserCmd} will
complete quickly and allow BackupPC_dump to finish up.

Craig

Post post user command 
"Ben Zampatti" writes:

Hey gday, I finally got around to trying this... But it doesn't seem to =
be working properly. This the $Conf{DumpPostUserCmd} variable:

$Conf{DumpPostUserCmd} =3D '/usr/bin/sudo /bin/sh =
/usr/local/scripts/pass-values.sh $host $xferOK';

and in pass-values.sh, I have the following:

#!/bin/bash

## Few comments...

HOST=3D$1
XFER=3D$2

if [ $XFER == 1 ]
then
/usr/local/scripts/scan-host.sh $HOST $XFER &
else
/usr/local/scripts/mail-backup.pl $HOST $XFER &
fi
sleep 5

Anyway, it still seems to be waiting for scan-host.sh to finish.

I don't have time to experiment or try to replicate this.
I'm not sure if BackupPC_dump is waiting on the background
process to complete. If so, you might try this:

if [ $XFER == 1 ]
then
nohup /usr/local/scripts/scan-host.sh $HOST $XFER &
else
nohup /usr/local/scripts/mail-backup.pl $HOST $XFER &
fi
sleep 5

(I have a sleep there so the scan-host.sh script scans the "new"
directory before BackupPC_dump renames new to a number...)

It better be fast: how can you be sure it runs fast enough?

Also, is there a way to tell which file BackupPC is currently backing
up? One of our hosts failed last night with ALM signal, possibly timeout
issue, not sure, could be something else, just was wondering if there
was a way thats all.

Look at the XferLOG.bad file.

Craig


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post post user command 
On Thu, 2004-03-18 at 19:19, Craig Barratt wrote:
"Ben Zampatti" writes:

Hey gday, I finally got around to trying this... But it doesn't seem to =
be working properly. This the $Conf{DumpPostUserCmd} variable:

$Conf{DumpPostUserCmd} =3D '/usr/bin/sudo /bin/sh =
/usr/local/scripts/pass-values.sh $host $xferOK';

and in pass-values.sh, I have the following:

#!/bin/bash

## Few comments...

HOST=3D$1
XFER=3D$2

if [ $XFER == 1 ]
then
/usr/local/scripts/scan-host.sh $HOST $XFER &
else
/usr/local/scripts/mail-backup.pl $HOST $XFER &
fi
sleep 5

Anyway, it still seems to be waiting for scan-host.sh to finish.

I don't have time to experiment or try to replicate this.
I'm not sure if BackupPC_dump is waiting on the background
process to complete. If so, you might try this:

if [ $XFER == 1 ]
then
nohup /usr/local/scripts/scan-host.sh $HOST $XFER &
else
nohup /usr/local/scripts/mail-backup.pl $HOST $XFER &
fi
sleep 5

(I have a sleep there so the scan-host.sh script scans the "new"
directory before BackupPC_dump renames new to a number...)

It better be fast: how can you be sure it runs fast enough?

Sorry Craig! I didn't think about this. Of course backuppc will try and
move the dir from new to the number while it's still scanning! I'll just
let it be. I'm only scanning the 'new' dir anyway which would take
bugger all time anyway (longer than 5 seconds though hehe). Don't think
backgrounding it with nohup will work but I'm not even going to bother
anymore.

Also, is there a way to tell which file BackupPC is currently backing
up? One of our hosts failed last night with ALM signal, possibly timeout
issue, not sure, could be something else, just was wondering if there
was a way thats all.

Look at the XferLOG.bad file.

Craig



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB