Hi Timothy,
Thanks for your post I could achieve my script from the analysis
you've done ! (and the perl script given as example)
Yes I confirm you're right, I've started an archive job and
cancelled after, and the process is still running... Really strange,
maybe a bug in backupPC ?
For the php code, the best way is to use the perl script indeed...
For my concern, as I haven't code a perl script from nearly 10
years, I had to code it into php, but perl is best for this, in
order to use Lib.pm (I have no more skills in perl)
I've done a workaround, a simple script.pl that justs json_encode a
backuppc object, in order to use it on the php side (pecl perl to
use perl into php or PHP::interpreter can do the same thing and
better but are obsolete and buggy, it doesn't compile in fact on my
ubuntu 10.10)
You can find in attachment those 2 files, (don't pay attention to
the licence, you can use it of course, or anyone else...)
My php file is specific to my need, not as generic as the test
script in perl given on the mailing list, in order to keep it simple
for my need
archive.php triggered an archive job for one specific server (it
takes the last backup done)
Hope this helps anyone that wants to code it with the php way
Cheers
Le 27/10/2010 16:52, Timothy J Massey a écrit :
Jérôme DESPATIS
<jerome.despatis AT source-rh DOT com>
wrote on 10/27/2010 09:19:59 AM:
> I'd like to
schedule an
archive job (launched by cron)
>
> While googling I've seen this very interesting post:
> http://www.mail-archive.com/backuppc-users AT lists.sourceforge DOT net/msg04469.html
Hey, that's me! :)
> And an example code:
> http://www.mail-archive.com/backuppc-users AT lists.sourceforge DOT net/msg04514.html
>
> From those inspiratio, i've created a very basic php
script
that sends
> the correct message to launch the archive job, it's ok and
working,
I
> can see the launching process in the log
>
> BUT: if I cancel the archive job with the CGI, everything
seems to
be
> fine, but ps uax tells me tar process is still active, and
in fact
the
> archive job is not stopped at all!
>
> I've created in fact a php script that creates the file
> archiveReq.xxx.0, xxx being replaced by the pid of my php
script
>
> => maybe backuppc really uses the value of xxx into this
filename
to
> kill the correct pid ? (and of course, this pid no more
exist, as
my php
> script is an external script that sends the message to
backuppc daemon
> and closes just after)
I don't think so: the same
technique
is used by the Perl code to create the archiveReq file. The
reason
that's done is to ensure a unique name, not to allow it to know
what the
PID is.
If you check the Server Status
page
while an archive is running, you'll see that BackupPC knows the
PID of
the process properly.
Here's a question: have you
tried
using the standard GUI to start and stop an archive? From my
recollection,
BackupPC won't kill the tar immediately even when it's started
from its
own GUI. I usually have to go in and kill the process manually
no
matter how the archive job is started. But my recollection may
be
incorrect.
On a different note, I would be
interested
to see your PHP code.
Timothy J. Massey
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
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/
--
|
Jérôme
Despatis
Chef de Projets
Source RH
Tèl / Fax : +33 (0)3 20 06 68 57
Mobile : +33 (0)6 87 46 46 24
www.source-rh.com
jerome.despatis AT source-rh DOT com
|
Ce message et, le cas écheant, les
pièces jointes sont strictement confidentiels
et destinés à l'usage exclusif de leur
destinataire. Il est interdit à toute personne
autre que leur destinataire de les lire,
copier, dupliquer et/ou communiquer à un tiers
quelconque. Si vous recevez ce message par
erreur, merci de le détruire et d'en aviser
immediatement l'expéditeur par e-mail.
This message and any attachment are
confidential and transmitted for the exclusive
use of the intended recipient. It is
prohibited for anyone other than the recipient
to read, copy, duplicate and/or disclose the
content to any third-person. Should you
receive this message by mistake, please delete
it and contact the sender by return e-mail.
|
|
|
archive.php
Description: application/httpd-php
backup_info_read.pl
Description: Perl program
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev _______________________________________________
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/
|