Automatic restore script issues

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatic restore script issues

Reinier Carmona Lizana
Hello, I am trying to do an automatic restore script, but I am having this issues:

# vim restore


bin/echo "restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes" | /usr/bin/bconsole


when i call the script like this

#./restore

i show me this:
 
Connecting to Director bacula-dir.red.sld.cu:9101
1000 OK: bacula-dir Version: 5.2.6 (21 February 2012)
Enter a period to cancel a command.
restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes
Using Catalog "MyCatalog"
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 248,718 | F     |    6,163 | 972,780,649 | 2017-03-06 23:30:30 | VA0203L3   |
| 248,874 | I     |       51 | 743,483,652 | 2017-03-07 16:09:19 | VA0208L3   |
| 249,030 | I     |       52 | 743,678,821 | 2017-03-08 02:00:02 | VA0208L3   |
| 248,956 | I     |       52 | 743,678,821 | 2017-03-08 02:00:14 | Vol_0069   |
| 249,113 | I     |       12 | 682,442,777 | 2017-03-08 19:38:26 | Vol_0078   |
| 249,189 | I     |       13 | 682,462,601 | 2017-03-08 20:32:25 | VA0208L3   |
| 249,273 | I     |      116 | 744,181,376 | 2017-03-09 17:58:42 | Vol_0066   |
| 249,349 | I     |      114 | 744,194,144 | 2017-03-09 18:54:46 | VA0208L3   |
| 249,433 | I     |       45 | 744,406,590 | 2017-03-10 07:26:33 | Vol_0068   |
| 249,509 | I     |       47 | 744,418,911 | 2017-03-10 08:05:28 | VA0208L3   |
+---------+-------+----------+-------------+---------------------+------------+
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 239,350 | F     |    6,137 | 803,816,815 | 2017-01-01 12:59:17 | VA0217L3   |
| 243,317 | D     |      172 | 590,776,475 | 2017-01-29 18:36:07 | VA0192L3   |
+---------+-------+----------+-------------+---------------------+------------+
You have selected the following JobIds: 239350,243317

Building directory tree for JobId(s) 239350,243317 ...  Bootstrap records written to /var/lib/bacula/bacula-dir.restore.7.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================
  
   *VA0217L3                  MSL6000                   Drive-0                 
   *VA0192L3                  MSL6000                   Drive-0                 

Volumes marked with "*" are online.


6,309 files selected to be restored.

The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

But in this point it return me to bash, I need a way to select one of this defined Restore Job resources,


The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

for example I want to choose number 3, what I could do? Any suggestions? Thanks in advanced.



------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Automatic restore script issues

Wanderlei Huttel
Post a print screen with the error.

Best regards

Wanderlei Hüttel

2017-03-10 16:00 GMT-03:00 Reinier Carmona Lizana <[hidden email]>:
The same thing, it keep kicking me.

2017-03-10 13:56 GMT-05:00 Wanderlei Huttel <[hidden email]>:
Sorry

You need to write quotations with escape:

/bin/echo "restore before=\"2017-01-30 08:00:00\" client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 restorejob=RestoreFilesExterno select all done yes" | /usr/bin/bconsole

Best regards

Wanderlei Hüttel

2017-03-10 15:54 GMT-03:00 Reinier Carmona Lizana <[hidden email]>:

Improper date format: 2017-01-30

I wrote like before

2017-01-30\ 08:00:00

and your suggestion. And everything is the same. I kick me to the bash console without choose the 3 options.


2017-03-10 13:41 GMT-05:00 Wanderlei Huttel <[hidden email]>:
I forgot a quotation before RestoreFilesExterno

/bin/echo "restore before="2017-01-30 08:00:00" client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/
bacula/archives/restore/mx5 restorejob=RestoreFilesExterno select all done yes" | /usr/bin/bconsole

Best regards

Wanderlei Hüttel

2017-03-10 15:40 GMT-03:00 Wanderlei Huttel <[hidden email]>:
Hello

Try this way.

/bin/echo "restore before="2017-01-30 08:00:00" client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 restorejob="RestoreFilesExterno select all done yes" | /usr/bin/bconsole



Best regards

Wanderlei Hüttel

2017-03-10 15:37 GMT-03:00 Reinier Carmona Lizana <[hidden email]>:
Hi, thanks for your answer i added this 

restorejob=RestoreFilesExterno yes"

and still is not working

this is the full orden.

/bin/echo "restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select restorejob="RestoreFilesExterno yes" | /usr/bin/bconsole




2017-03-10 13:10 GMT-05:00 Wanderlei Huttel <[hidden email]>:
Hello Reiner

This is because you have more than one restore job.
Include this parameter in your script that that will works fine
restorejob="Some Restore Job Name"

Best regards

Wanderlei Hüttel

2017-03-10 15:02 GMT-03:00 Reinier Carmona Lizana <[hidden email]>:
Hello, I am trying to do an automatic restore script, but I am having this issues:

# vim restore


bin/echo "restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes" | /usr/bin/bconsole


when i call the script like this

#./restore

i show me this:
 
Connecting to Director bacula-dir.red.sld.cu:9101
1000 OK: bacula-dir Version: 5.2.6 (21 February 2012)
Enter a period to cancel a command.
restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes
Using Catalog "MyCatalog"
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 248,718 | F     |    6,163 | 972,780,649 | 2017-03-06 23:30:30 | VA0203L3   |
| 248,874 | I     |       51 | 743,483,652 | 2017-03-07 16:09:19 | VA0208L3   |
| 249,030 | I     |       52 | 743,678,821 | 2017-03-08 02:00:02 | VA0208L3   |
| 248,956 | I     |       52 | 743,678,821 | 2017-03-08 02:00:14 | Vol_0069   |
| 249,113 | I     |       12 | 682,442,777 | 2017-03-08 19:38:26 | Vol_0078   |
| 249,189 | I     |       13 | 682,462,601 | 2017-03-08 20:32:25 | VA0208L3   |
| 249,273 | I     |      116 | 744,181,376 | 2017-03-09 17:58:42 | Vol_0066   |
| 249,349 | I     |      114 | 744,194,144 | 2017-03-09 18:54:46 | VA0208L3   |
| 249,433 | I     |       45 | 744,406,590 | 2017-03-10 07:26:33 | Vol_0068   |
| 249,509 | I     |       47 | 744,418,911 | 2017-03-10 08:05:28 | VA0208L3   |
+---------+-------+----------+-------------+---------------------+------------+
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 239,350 | F     |    6,137 | 803,816,815 | 2017-01-01 12:59:17 | VA0217L3   |
| 243,317 | D     |      172 | 590,776,475 | 2017-01-29 18:36:07 | VA0192L3   |
+---------+-------+----------+-------------+---------------------+------------+
You have selected the following JobIds: 239350,243317

Building directory tree for JobId(s) 239350,243317 ...  Bootstrap records written to /var/lib/bacula/bacula-dir.restore.7.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================
  
   *VA0217L3                  MSL6000                   Drive-0                 
   *VA0192L3                  MSL6000                   Drive-0                 

Volumes marked with "*" are online.


6,309 files selected to be restored.

The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

But in this point it return me to bash, I need a way to select one of this defined Restore Job resources,


The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

for example I want to choose number 3, what I could do? Any suggestions? Thanks in advanced.



------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users





--
Ing. Reinier Carmona Lizana

Usuario Linux registrado: #483 500
Usuario Ubuntu registrado #27 296





--
Ing. Reinier Carmona Lizana

Usuario Linux registrado: #483 500
Usuario Ubuntu registrado #27 296




--
Ing. Reinier Carmona Lizana

Usuario Linux registrado: #483 500
Usuario Ubuntu registrado #27 296


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Automatic restore script issues

Heitor Faria
In reply to this post by Reinier Carmona Lizana
Hello, Reinier,

Hello, I am trying to do an automatic restore script, but I am having this issues:
# vim restore

bin/echo "restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes" | /usr/bin/bconsole


when i call the script like this

#./restore

i show me this:

Connecting to Director bacula-dir.red.sld.cu:9101
1000 OK: bacula-dir Version: 5.2.6 (21 February 2012)
Enter a period to cancel a command.
restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes
Using Catalog "MyCatalog"
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 248,718 | F     |    6,163 | 972,780,649 | 2017-03-06 23:30:30 | VA0203L3   |
| 248,874 | I     |       51 | 743,483,652 | 2017-03-07 16:09:19 | VA0208L3   |
| 249,030 | I     |       52 | 743,678,821 | 2017-03-08 02:00:02 | VA0208L3   |
| 248,956 | I     |       52 | 743,678,821 | 2017-03-08 02:00:14 | Vol_0069   |
| 249,113 | I     |       12 | 682,442,777 | 2017-03-08 19:38:26 | Vol_0078   |
| 249,189 | I     |       13 | 682,462,601 | 2017-03-08 20:32:25 | VA0208L3   |
| 249,273 | I     |      116 | 744,181,376 | 2017-03-09 17:58:42 | Vol_0066   |
| 249,349 | I     |      114 | 744,194,144 | 2017-03-09 18:54:46 | VA0208L3   |
| 249,433 | I     |       45 | 744,406,590 | 2017-03-10 07:26:33 | Vol_0068   |
| 249,509 | I     |       47 | 744,418,911 | 2017-03-10 08:05:28 | VA0208L3   |
+---------+-------+----------+-------------+---------------------+------------+
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 239,350 | F     |    6,137 | 803,816,815 | 2017-01-01 12:59:17 | VA0217L3   |
| 243,317 | D     |      172 | 590,776,475 | 2017-01-29 18:36:07 | VA0192L3   |
+---------+-------+----------+-------------+---------------------+------------+
You have selected the following JobIds: 239350,243317

Building directory tree for JobId(s) 239350,243317 ...  Bootstrap records written to /var/lib/bacula/bacula-dir.restore.7.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================

   *VA0217L3                  MSL6000                   Drive-0                 
   *VA0192L3                  MSL6000                   Drive-0                 

Volumes marked with "*" are online.


6,309 files selected to be restored.

The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

But in this point it return me to bash, I need a way to select one of this defined Restore Job resources,
You don't really need multiple Restore Jobs configured in bacula-dir.conf. Anyway, I'm not sure if you have a keyword for this if you need to choose one of the above (v.g.: job=): http://www.bacula.org/5.1.x-manuals/en/main/main/Restore_Command.html

Regards,
The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

for example I want to choose number 3, what I could do? Any suggestions? Thanks in advanced.

--
===========================================================================
Heitor Medrado de Faria  | Bacula do Brasil
• Não seja tarifado pelo tamanho dos seus backups, conheça o Bacula Enterprise: http://www.bacula.com.br/enterprise/
 Ministro treinamento e implementação in-company do Bacula Community: http://www.bacula.com.br/in-company/
(61) 98268-4220 | www.bacula.com.br 
============================================================================
Indicamos também as capacitações complementares:
 Shell básico e Programação em Shell com Julio Neves.
 Zabbix com Adail Host.
============================================================================

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Automatic restore script issues

Wanderlei Huttel
There is another alternative, but I don't know if will works. You need to try

################################
#!/bin/bash
var="$(cat <<EOF
restore before=\"2017-01-30 08:00:00\" client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 select all done yes
3
EOF
)"
echo "$var" | /usr/bin/bconsole


Best Regards

Wanderlei Hüttel

2017-03-10 16:19 GMT-03:00 Heitor Faria <[hidden email]>:
Hello, Reinier,

Hello, I am trying to do an automatic restore script, but I am having this issues:
# vim restore

bin/echo "restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes" | /usr/bin/bconsole


when i call the script like this

#./restore

i show me this:

Connecting to Director bacula-dir.red.sld.cu:9101
1000 OK: bacula-dir Version: 5.2.6 (21 February 2012)
Enter a period to cancel a command.
restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes
Using Catalog "MyCatalog"
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 248,718 | F     |    6,163 | 972,780,649 | 2017-03-06 23:30:30 | VA0203L3   |
| 248,874 | I     |       51 | 743,483,652 | 2017-03-07 16:09:19 | VA0208L3   |
| 249,030 | I     |       52 | 743,678,821 | 2017-03-08 02:00:02 | VA0208L3   |
| 248,956 | I     |       52 | 743,678,821 | 2017-03-08 02:00:14 | Vol_0069   |
| 249,113 | I     |       12 | 682,442,777 | 2017-03-08 19:38:26 | Vol_0078   |
| 249,189 | I     |       13 | 682,462,601 | 2017-03-08 20:32:25 | VA0208L3   |
| 249,273 | I     |      116 | 744,181,376 | 2017-03-09 17:58:42 | Vol_0066   |
| 249,349 | I     |      114 | 744,194,144 | 2017-03-09 18:54:46 | VA0208L3   |
| 249,433 | I     |       45 | 744,406,590 | 2017-03-10 07:26:33 | Vol_0068   |
| 249,509 | I     |       47 | 744,418,911 | 2017-03-10 08:05:28 | VA0208L3   |
+---------+-------+----------+-------------+---------------------+------------+
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 239,350 | F     |    6,137 | 803,816,815 | 2017-01-01 12:59:17 | VA0217L3   |
| 243,317 | D     |      172 | 590,776,475 | 2017-01-29 18:36:07 | VA0192L3   |
+---------+-------+----------+-------------+---------------------+------------+
You have selected the following JobIds: 239350,243317

Building directory tree for JobId(s) 239350,243317 ...  Bootstrap records written to /var/lib/bacula/bacula-dir.restore.7.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================

   *VA0217L3                  MSL6000                   Drive-0                 
   *VA0192L3                  MSL6000                   Drive-0                 

Volumes marked with "*" are online.


6,309 files selected to be restored.

The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

But in this point it return me to bash, I need a way to select one of this defined Restore Job resources,
You don't really need multiple Restore Jobs configured in bacula-dir.conf. Anyway, I'm not sure if you have a keyword for this if you need to choose one of the above (v.g.: job=): http://www.bacula.org/5.1.x-manuals/en/main/main/Restore_Command.html

Regards,
The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

for example I want to choose number 3, what I could do? Any suggestions? Thanks in advanced.

--
===========================================================================
Heitor Medrado de Faria  | Bacula do Brasil
• Não seja tarifado pelo tamanho dos seus backups, conheça o Bacula Enterprise: http://www.bacula.com.br/enterprise/
 Ministro treinamento e implementação in-company do Bacula Community: http://www.bacula.com.br/in-company/
(61) 98268-4220 | www.bacula.com.br 
============================================================================
Indicamos também as capacitações complementares:
 Shell básico e Programação em Shell com Julio Neves.
 Zabbix com Adail Host.
============================================================================

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users



------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Automatic restore script issues

Wanderlei Huttel
The last try or ou need to update your bacula server:

################################
#!/bin/bash
var="$(cat <<EOF
restore before=\"2017-01-30 08:00:00\" client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 select all done
3
yes
EOF
)"
echo "$var" | /usr/bin/bconsole


Best regards

Wanderlei Hüttel

2017-03-10 16:59 GMT-03:00 Reinier Carmona Lizana <[hidden email]>:
I tried this too, but with 3, it said me that it was an unknown keyword

2017-03-10 14:55 GMT-05:00 Wanderlei Huttel <[hidden email]>:
There is another alternative, but I don't know if will works. You need to try

################################
#!/bin/bash
var="$(cat <<EOF
restore before=\"2017-01-30 08:00:00\" client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 select all done yes
3
EOF
)"
echo "$var" | /usr/bin/bconsole


Best Regards

Wanderlei Hüttel

2017-03-10 16:19 GMT-03:00 Heitor Faria <[hidden email]>:
Hello, Reinier,

Hello, I am trying to do an automatic restore script, but I am having this issues:
# vim restore

bin/echo "restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes" | /usr/bin/bconsole


when i call the script like this

#./restore

i show me this:

Connecting to Director bacula-dir.red.sld.cu:9101
1000 OK: bacula-dir Version: 5.2.6 (21 February 2012)
Enter a period to cancel a command.
restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes
Using Catalog "MyCatalog"
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 248,718 | F     |    6,163 | 972,780,649 | 2017-03-06 23:30:30 | VA0203L3   |
| 248,874 | I     |       51 | 743,483,652 | 2017-03-07 16:09:19 | VA0208L3   |
| 249,030 | I     |       52 | 743,678,821 | 2017-03-08 02:00:02 | VA0208L3   |
| 248,956 | I     |       52 | 743,678,821 | 2017-03-08 02:00:14 | Vol_0069   |
| 249,113 | I     |       12 | 682,442,777 | 2017-03-08 19:38:26 | Vol_0078   |
| 249,189 | I     |       13 | 682,462,601 | 2017-03-08 20:32:25 | VA0208L3   |
| 249,273 | I     |      116 | 744,181,376 | 2017-03-09 17:58:42 | Vol_0066   |
| 249,349 | I     |      114 | 744,194,144 | 2017-03-09 18:54:46 | VA0208L3   |
| 249,433 | I     |       45 | 744,406,590 | 2017-03-10 07:26:33 | Vol_0068   |
| 249,509 | I     |       47 | 744,418,911 | 2017-03-10 08:05:28 | VA0208L3   |
+---------+-------+----------+-------------+---------------------+------------+
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 239,350 | F     |    6,137 | 803,816,815 | 2017-01-01 12:59:17 | VA0217L3   |
| 243,317 | D     |      172 | 590,776,475 | 2017-01-29 18:36:07 | VA0192L3   |
+---------+-------+----------+-------------+---------------------+------------+
You have selected the following JobIds: 239350,243317

Building directory tree for JobId(s) 239350,243317 ...  Bootstrap records written to /var/lib/bacula/bacula-dir.restore.7.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================

   *VA0217L3                  MSL6000                   Drive-0                 
   *VA0192L3                  MSL6000                   Drive-0                 

Volumes marked with "*" are online.


6,309 files selected to be restored.

The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

But in this point it return me to bash, I need a way to select one of this defined Restore Job resources,
You don't really need multiple Restore Jobs configured in bacula-dir.conf. Anyway, I'm not sure if you have a keyword for this if you need to choose one of the above (v.g.: job=): http://www.bacula.org/5.1.x-manuals/en/main/main/Restore_Command.html

Regards,
The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

for example I want to choose number 3, what I could do? Any suggestions? Thanks in advanced.

--
===========================================================================
Heitor Medrado de Faria  | Bacula do Brasil
• Não seja tarifado pelo tamanho dos seus backups, conheça o Bacula Enterprise: http://www.bacula.com.br/enterprise/
 Ministro treinamento e implementação in-company do Bacula Community: http://www.bacula.com.br/in-company/
(61) 98268-4220 | www.bacula.com.br 
============================================================================
Indicamos também as capacitações complementares:
 Shell básico e Programação em Shell com Julio Neves.
 Zabbix com Adail Host.
============================================================================

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users





--
Ing. Reinier Carmona Lizana

Usuario Linux registrado: #483 500
Usuario Ubuntu registrado #27 296


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users
Reply | Threaded
Open this post in threaded view
|

Re: Automatic restore script issues

Wanderlei Huttel
Try this to update


Best regards

Wanderlei Hüttel
Enviado de Motorola Moto X2

Em 10 de mar de 2017 17:18, "Reinier Carmona Lizana" <[hidden email]> escreveu:
I am using on a Debian 8.6 the version 5.2.6+dfsg-9.3. Best regards


2017-03-10 15:10 GMT-05:00 Wanderlei Huttel <[hidden email]>:
The last try or ou need to update your bacula server:

################################
#!/bin/bash
var="$(cat <<EOF
restore before=\"2017-01-30 08:00:00\" client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 select all done
3
yes
EOF
)"
echo "$var" | /usr/bin/bconsole


Best regards

Wanderlei Hüttel

2017-03-10 16:59 GMT-03:00 Reinier Carmona Lizana <[hidden email]>:
I tried this too, but with 3, it said me that it was an unknown keyword

2017-03-10 14:55 GMT-05:00 Wanderlei Huttel <[hidden email]>:
There is another alternative, but I don't know if will works. You need to try

################################
#!/bin/bash
var="$(cat <<EOF
restore before=\"2017-01-30 08:00:00\" client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 select all done yes
3
EOF
)"
echo "$var" | /usr/bin/bconsole


Best Regards

Wanderlei Hüttel

2017-03-10 16:19 GMT-03:00 Heitor Faria <[hidden email]>:
Hello, Reinier,

Hello, I am trying to do an automatic restore script, but I am having this issues:
# vim restore

bin/echo "restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes" | /usr/bin/bconsole


when i call the script like this

#./restore

i show me this:

Connecting to Director bacula-dir.red.sld.cu:9101
1000 OK: bacula-dir Version: 5.2.6 (21 February 2012)
Enter a period to cancel a command.
restore select all before=2017-01-30\ 08:00:00 client=mx5-fd restoreclient=finlay-fd where=/mnt/externo/bacula/bacula/archives/restore/mx5 done select yes
Using Catalog "MyCatalog"
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 248,718 | F     |    6,163 | 972,780,649 | 2017-03-06 23:30:30 | VA0203L3   |
| 248,874 | I     |       51 | 743,483,652 | 2017-03-07 16:09:19 | VA0208L3   |
| 249,030 | I     |       52 | 743,678,821 | 2017-03-08 02:00:02 | VA0208L3   |
| 248,956 | I     |       52 | 743,678,821 | 2017-03-08 02:00:14 | Vol_0069   |
| 249,113 | I     |       12 | 682,442,777 | 2017-03-08 19:38:26 | Vol_0078   |
| 249,189 | I     |       13 | 682,462,601 | 2017-03-08 20:32:25 | VA0208L3   |
| 249,273 | I     |      116 | 744,181,376 | 2017-03-09 17:58:42 | Vol_0066   |
| 249,349 | I     |      114 | 744,194,144 | 2017-03-09 18:54:46 | VA0208L3   |
| 249,433 | I     |       45 | 744,406,590 | 2017-03-10 07:26:33 | Vol_0068   |
| 249,509 | I     |       47 | 744,418,911 | 2017-03-10 08:05:28 | VA0208L3   |
+---------+-------+----------+-------------+---------------------+------------+
Automatically selected FileSet: Standard Set
+---------+-------+----------+-------------+---------------------+------------+
| JobId   | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+---------+-------+----------+-------------+---------------------+------------+
| 239,350 | F     |    6,137 | 803,816,815 | 2017-01-01 12:59:17 | VA0217L3   |
| 243,317 | D     |      172 | 590,776,475 | 2017-01-29 18:36:07 | VA0192L3   |
+---------+-------+----------+-------------+---------------------+------------+
You have selected the following JobIds: 239350,243317

Building directory tree for JobId(s) 239350,243317 ...  Bootstrap records written to /var/lib/bacula/bacula-dir.restore.7.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================

   *VA0217L3                  MSL6000                   Drive-0                 
   *VA0192L3                  MSL6000                   Drive-0                 

Volumes marked with "*" are online.


6,309 files selected to be restored.

The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

But in this point it return me to bash, I need a way to select one of this defined Restore Job resources,
You don't really need multiple Restore Jobs configured in bacula-dir.conf. Anyway, I'm not sure if you have a keyword for this if you need to choose one of the above (v.g.: job=): http://www.bacula.org/5.1.x-manuals/en/main/main/Restore_Command.html

Regards,
The defined Restore Job resources are:
     1: RestoreFiles EVA
     2: RestoreFiles
     3: RestoreFilesExterno
Select Restore Job (1-3):

for example I want to choose number 3, what I could do? Any suggestions? Thanks in advanced.

--
===========================================================================
Heitor Medrado de Faria  | Bacula do Brasil
• Não seja tarifado pelo tamanho dos seus backups, conheça o Bacula Enterprise: http://www.bacula.com.br/enterprise/
 Ministro treinamento e implementação in-company do Bacula Community: http://www.bacula.com.br/in-company/
(61) 98268-4220 | www.bacula.com.br 
============================================================================
Indicamos também as capacitações complementares:
 Shell básico e Programação em Shell com Julio Neves.
 Zabbix com Adail Host.
============================================================================

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users





--
Ing. Reinier Carmona Lizana

Usuario Linux registrado: #483 500
Usuario Ubuntu registrado #27 296




--
Ing. Reinier Carmona Lizana

Usuario Linux registrado: #483 500
Usuario Ubuntu registrado #27 296

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Bacula-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/bacula-users