Hi all, On Tuesday 09 January 2007 18:02, Misty Stanley-Jones wrote: > I'm looking for some ideas about how to create a Restore job such that a > random file, from a random client, from a random backup (which has not been > pruned, obviously) will be picked to be restored. I have been just > arbitrarily choosing a file to restore, but it will never be even close to > random, and isn't really a great way to test the backups. Great Idea. > > > > Someone on the IRC channel got me started with the following query: > > select * from File order by RAND() limit 1
> > > > This just gives me the FileId, and I would need to join with another table > to get the file name and which client it belongs to. But is there a better > way to approach this? From the Bacula Manual about restore : 7: Enter a list of files to restore: If you prefix the filename with a question mark (?), then the filename will be interpreted as an SQL table name, and Bacula will include the rows of that table in the list to be restored. The table must contain the JobId in the first column and the FileIndex in the second column. This table feature is intended for external programs that want to build their own list of files to be restored. JobID and FileIndex are columns of File. Just build a temp Table or whatever. > > > > Also, I would like to be able to schedule this restore to happen once per > week. Is that possible? Kern Sibbald wrote: However, it is possible to schedule an Admin job that calls a RunScript that then scripts the restore with bconsole. And then let nagios check if the files really got restored. something like "find /mnt/restore -ctime -6" Awesome. Cheers, Christoph -- NMMN - New Media Markets & Networks GmbH http://www.nmmn.com Tel.: +49 40 284 118 -0 Langbehnstrasse 6 Technische Hotline -700 22761 Hamburg Fax: -999 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users