BackupPC-users

[BackupPC-users] Fwd: Re: Execute script before backup

2014-12-16 14:49:27
Subject: [BackupPC-users] Fwd: Re: Execute script before backup
From: Russell Poyner <russell.poyner AT wisc DOT edu>
To: "backuppc-users AT lists.sourceforge DOT net" <backuppc-users AT lists.sourceforge DOT net>
Date: Tue, 16 Dec 2014 13:47:07 -0600
I'll agree with Les here. I think there should be a way to do this
either through PingCmd or through DumpPreUserCmd.  My current set up (48
mostly windows clients) has customized scripts for both of these.
PingCmd sends wake on lan packets and waits several minutes to see if
the host responds. DumpPreUserCmd modifies an html file that the client
polls every 5 minutes. When the client reads a start signal in the html
file it creates a shadow copy and launches rsync daemon on it. While
that is going on DumpPreUserCmd is waiting and polling for up to 20
minutes to see if the client launches the rsync daemon. DumpPostUserCmd
modifies the html back to the stop state. When the client sees that it
stops the rsync daemon and deletes the shadow copy.

The idea is that you can achieve pretty sophisticated behaviour with
PingCmd, DumpPreUserCmd and DumpPostUserCmd. I'd think you could stand
up the vpn with the pre command and tear it down with the post command.

The way to start is to write your scripts and test them by hand until
they are doing what you want. Then configure backuppc to use them either
as PingCmd or DumpPreUserCmd and DumpPostUserCmd. You communicate
success or failure of your script to backuppc through the exit status.
exit 0 from PingCmd means the host is reachable on the network (ie the
"ping" worked). exit 0 from DumpPreUserCmd causes backuppc to start the
dump, provided that $Conf{UserCmdCheckStatus} = 1;

Think of it as an opportunity to prove your scripting skills and have fun!

RP



On 12/16/2014 11:18 AM, Les Mikesell wrote:
> On Tue, Dec 16, 2014 at 4:31 AM, Ibon Castilla <ibon.castilla AT gmail DOT 
> com> wrote:
>> Hi there,
>>
>> I'm trying to figure out how to execute some actions, right before
>> doing a backup. What I want to do is to backup a remote host (not in
>> the LAN) and to achieve so I have a VPN tunnel set up. My ideal
>> scenario would be: 1) before anything else connect to the tunnel, 2)
>> then backup the host, 3) after successful backup close the tunnel.
>>
>> What I try so far:
>> * Play with $Conf{DumpPreUserCmd}. As I have read in the
>> documentation, this parameter has been thought to execute some
>> commands after I reach the host, and before doing the dump, so not
>> applicable to my scenario.
>> * Play with $Conf{RsyncClientCmd}. Before 'ssh-ing' anything I have
>> tried to set up the VPN tunnel, but again there is a host resolution
>> command before this, and obviously it fails.
> I haven't tried it, but I would think you could use PingCmd to run a
> script that brings up the VPN (possibly needing ClientNameAlias to be
> set to the IP of the remote endpoint to avoid lookups before
> connecting), and perhaps a DumpPostUserCmd to close the connection.
>




------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
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>