Bacula-users

[Bacula-users] scripted restore not failsafe

2014-02-19 12:01:46
Subject: [Bacula-users] scripted restore not failsafe
From: Christoph Kluenter <ck AT iphh DOT net>
To: bacula-users AT lists.sourceforge DOT net
Date: Wed, 19 Feb 2014 17:40:37 +0100
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?

Cheers,
  Christoph

-- 
Christoph Kluenter                   E-Mail: support AT iphh DOT net
Technik                              Tel: +49 (0)40 374919-10
IPHH Internet Port Hamburg GmbH      Fax: +49 (0)40 374919-29
Wendenstrasse 408                    AG Hamburg, HRB 76071
D-20537 Hamburg                      Geschaeftsfuehrung: Axel G. Kroeger

------------------------------------------------------------------------------
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>