Bacula-users

Re: [Bacula-users] scripted restore not failsafe

2014-02-19 14:24:25
Subject: Re: [Bacula-users] scripted restore not failsafe
From: Martin Simmons <martin AT lispworks DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Wed, 19 Feb 2014 19:22:10 GMT
>>>>> On Wed, 19 Feb 2014 17:40:37 +0100, Christoph Kluenter said:
> 
> Hi everybody,
> 
> I have server1 which creates files at
> /somewhere/$YEAR/$MONTH/$DAY/ on a daily basis.
> 
> I want to restore this directory to server2.
> So far, I have come up with this script:
> 
> /usr/sbin/bconsole << EOF
> restore client=server1 select current 
> strip_prefix=/somewhere/$YEAR/$MONTH/$DAY add_prefix=/somewhereelse/
> restoreclient=server2
> cd /somewhere/$YEAR/$MONTH/$DAY
> mark *
> done
> yes
> EOF 
> 
> The problem now is, if the "cd /somewhere/..." fails, then the next line
> marks everything. The "cd" could fail, if the last backup of server1 didn't
> run or the directory was not created for whatever reason.
> Is there a way to fail if the path is not in the backup?

You could run bconsole under something like Expect to detect the error from
cd.

__Martin

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

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