partial restore of a directory + subdirectory

83 views
Skip to first unread message

tilmang...@googlemail.com

unread,
Mar 29, 2022, 7:52:41 PM3/29/22
to bareos-users
I would like  to restore only a part of a backup, i.e. a directory and its subdirectories. How would I do this? The file parameter seems to only work for one file. Do I do this with ?

restore where=/tmp restoreclient=restore-fd client=client-fd storage=TapeStorage2  restorejob=RestoreFilesClient jobid=3107 replace=never  directory=/etc/

Here I get an error message which might point to a different problem and not be related to the command itself:
Forward spacing Volume "PRV012L4" to file:block 0:1.
 Error: stored/block.cc:1056 Read error on fd=8 at file:blk 0:1 on device "TapeDrive2" (/dev/tape/by-id/scsi-3500110a00093f7ed-nst). ERR=Cannot allocate memory.
 Releasing device "TapeDrive2" (/dev/tape/by-id/scsi-3500110a00093f7ed-nst).
Fatal error: stored/fd_cmds.cc:235 Command error with FD, hanging up.
Connected Storage daemon at restore.fritz.box:9103, encryption: TLS_AES_256_GCM_SHA384 TLSv1.3


Thanks
Tilman

tilmang...@googlemail.com

unread,
Mar 30, 2022, 9:57:46 AM3/30/22
to bareos-users
Dear all

the error message was indeed not related to the command itself. After rebooting, it vanished.

The partial restore of a directory tree I realized using grep. I wonder, it there are more convenient approaches:
> echo "list files jobid=3107" | bconsole -c /etc/bareos | grep 'etc' | sed -e 's/^\ //g' > /tmp/filelist.txt
> bconsole -c /etc/bareos |
* restore  where=/tmp/ restoreclient=utron1-fd client=utron1-fd storage=TapeStorage2  restorejob=RestoreFilesUtron1 jobid=3107 replace=always  file=</tmp/filelist.txt

Remark: bconsole produces a leading space as beginning of each line. The regular expression of  the  sed command weeds it out...

So again, if the same can be accomplished by using bconsole exclusively, I would be interested in learning about it.

Many thanks

Tilman

luk...@borek.org.pl

unread,
Mar 3, 2023, 1:32:28 AM3/3/23
to bareos-users
Hi Tilman

Also was hit by thie issue. Try : 

root@bb:~# echo -e  "restore restoreclient=bb-fd where=/tmp/ble client=c1 select current\nmark /etc\ndone\nyes" | bconsole

Wondering if there is a reason why batch mode select is not implemented. 

Reply all
Reply to author
Forward
0 new messages