>>>>> On Tue, 21 Apr 2020 14:13:11 +0200, Radosław Korzeniewski said: > > Hello, > > pon., 20 kwi 2020 o 19:30 Jose Alberto <[email protected]> napisał(a): > > > Hi. > > > > 1) Its Possiible save file mybbdd.sql when exe restore?? I don't want > >>> the bbdd to be restored automatically. for test,i Delete line > >>> mybbdd:/......mysqldump.sh -R but fails. > >>> > >> > >> The short answer is - Yes. You can do it without a problem. But I do not > >> understand what is not working in your case. So I cannot help you. > >> > >> [email protected] > >> > > > > When try restore in another client (file .sql), it fails. > > > > When restore in same client, good. But restore directly in the bbdd. > > > > I dont know restore without restore directly in BBDD. I want restore > > only file .sql place it in any folder of the filesystem. > > > > I still do not understand. And you did not provide any error logs. So, I do > not know how to help. Sorry. > > The bpipe plugin works in such a way that it uses two scripts provided by > backup admin to handle backup and restore streams on stdout/stdin. > The first script is used for backup jobs and the second one for restore > jobs respectively. When doing backup the script is responsible for > generating archive data stream on its stdout. So the restore script is > responsible for reading the archive data stream on its stdin and performing > the restore. > So the simplest scripts which show the principle of operation are: > > ---8<--- backup ---8<--- > #!/bin/sh > echo "This is the archive data stream sent to stdout" > ---8<--- > > ---8<--- restore ---8<--- > #!/bin/sh > cat > /tmp/restored_file.txt > ---8<--- > > The data generated by the first script will be saved in Bacula and during > restore this data will be forwarded to restore script which can do with > this data whatever it wants, i.e. save to file or restore database.
In particular, the plugin was defined in the original email like this: bpipe:/test/mybbdd.sql:/opt/bacula/log/mysqldump.sh mybbdd:/opt/bacula/log/mysqldump.sh -R so the backup runs: /opt/bacula/log/mysqldump.sh mybbdd and the restore runs: /opt/bacula/log/mysqldump.sh -R To make it restore to a file, you either need to change what /opt/bacula/log/mysqldump.sh does with the -R argument or use a different restore script like in Radek's example using cat. __Martin _______________________________________________ Bacula-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-users
