Bacula-users

[Bacula-users] Restore multiple versions of a file

2016-03-11 11:38:25
Subject: [Bacula-users] Restore multiple versions of a file
From: Wanderlei Huttel <wanderleihuttel AT gmail DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 11 Mar 2016 13:32:29 -0300
Hello 

Sometime you don't know which specific version of file you need, and is necessary do a lot of restores to get the  correct file.

So I've created a shell script to to do this in a single restore (bacula executes multiples restores, but the user select JobId's just once)


Example:

#############################################################

List Jobs where a given File is saved
Defined Clients:
    1:srv_firewall-fd
    2:srv_intranet-fd
    3:srv_bacula-fd
Select the Client (1-3): 3

Client selected: srv_bacula-fd

Defined Restore Clients:
    1:srv_firewall-fd
    2:srv_intranet-fd
    3:srv_bacula-fd
Select the Restore Client (1-3): 3

Restore Client selected: srv_bacula-fd

Type filename without path: bacula.sql

Type part or full path: working

+------+--------------------------------+---------------------+---+---+------+-----------+
| 3627 | /etc/bacula/working/bacula.sql | 2016-03-10 22:01:04 | B | T |   16 | 128129075 |
| 3612 | /etc/bacula/working/bacula.sql | 2016-03-09 22:07:12 | B | T |   16 | 128098168 |
| 3594 | /etc/bacula/working/bacula.sql | 2016-03-08 22:05:25 | B | T |   16 | 128249012 |
| 3578 | /etc/bacula/working/bacula.sql | 2016-03-07 22:02:58 | B | T |   16 | 128208441 |
| 3561 | /etc/bacula/working/bacula.sql | 2016-03-04 21:03:34 | B | T |   15 | 128538149 |
| 3546 | /etc/bacula/working/bacula.sql | 2016-03-03 22:02:41 | B | T |   16 | 119186127 |
| 3531 | /etc/bacula/working/bacula.sql | 2016-03-02 22:03:09 | B | T |   16 | 119236350 |
| 3516 | /etc/bacula/working/bacula.sql | 2016-03-01 22:04:51 | B | T |   16 | 119117818 |
| 3501 | /etc/bacula/working/bacula.sql | 2016-02-29 22:01:54 | B | T |   16 | 119071397 |
| 3485 | /etc/bacula/working/bacula.sql | 2016-02-26 21:27:58 | B | T |   16 | 119420184 |
| 3470 | /etc/bacula/working/bacula.sql | 2016-02-25 22:28:50 | B | T |   15 | 119201859 |
| 3455 | /etc/bacula/working/bacula.sql | 2016-02-24 22:04:10 | B | T |   16 | 119141077 |
| 3440 | /etc/bacula/working/bacula.sql | 2016-02-23 22:01:04 | B | T |   15 | 119156127 |
| 3425 | /etc/bacula/working/bacula.sql | 2016-02-22 22:04:50 | B | T |   12 | 119105851 |
| 3409 | /etc/bacula/working/bacula.sql | 2016-02-20 03:15:14 | B | T |   19 | 119103785 |
| 3394 | /etc/bacula/working/bacula.sql | 2016-02-18 22:00:34 | B | T |   15 | 119050832 |
| 3379 | /etc/bacula/working/bacula.sql | 2016-02-17 21:55:18 | B | T |   15 | 119007857 |
| 3364 | /etc/bacula/working/bacula.sql | 2016-02-16 21:55:39 | B | T |   15 | 118966820 |
| 3348 | /etc/bacula/working/bacula.sql | 2016-02-15 21:58:35 | B | T |   11 | 119066292 |
| 3332 | /etc/bacula/working/bacula.sql | 2016-02-13 02:51:14 | B | T |   20 | 119123690 |
+------+--------------------------------+---------------------+---+---+------+-----------+

Enter JobId(s), comma separated, to restore: 3627,3612,3594,3578,3561,3546

root@bacula:# ls -l /tmp/bacula_restore/
drwxr-xr-x 3 root root 4096 Mar 11 11:22 3546_20160303_220241
drwxr-xr-x 3 root root 4096 Mar 11 11:22 3561_20160304_210334
drwxr-xr-x 3 root root 4096 Mar 11 11:22 3578_20160307_220258
drwxr-xr-x 3 root root 4096 Mar 11 11:22 3594_20160308_220525
drwxr-xr-x 3 root root 4096 Mar 11 11:22 3612_20160309_220712
drwxr-xr-x 3 root root 4096 Mar 11 11:22 3627_20160310_220104
drwxr-xr-x 2 root root 4096 Mar 11 11:22 bsr
#############################################################



Atenciosamente 

Wanderlei Hüttel

Attachment: _restore_multiple_versions_of_file.sh
Description: Bourne shell script

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
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>
  • [Bacula-users] Restore multiple versions of a file, Wanderlei Huttel <=