>>>>> 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users