Page 1 of 1

Backup Procedure

Posted: Fri Nov 05, 2021 12:36 pm
by Mr71
I've inserted a button that successfully performs the procedure of back-up of the database.
Two questions:
1) is it possible to assign for other users the backup procedure in "access level"?! (and avoid "Access Denied"?!)
2) would it be possible to download the gzip backup file instead of keeping it on the server!?

Thanks ...

Re: Backup Procedure

Posted: Fri Nov 05, 2021 12:49 pm
by kev1n
Hi,


Create a new Procedure that will run nuBuilder's backup procedure and assign access levels.

Code: Select all

$p = nuProcedure('nubackup');
eval($p);
The variable $dump_file contains the path to the file. Use readfile() to download it to the browser.

Re: Backup Procedure

Posted: Fri Nov 05, 2021 3:33 pm
by Mr71
I created the procedure with your code, tested.... works, assigned to userA, login with the userA, click on the button and ... Access To Procedure Denied... (nubackup)

it's seems only for the administrator....

Re: Backup Procedure

Posted: Fri Nov 05, 2021 4:02 pm
by kev1n
What code does the button run?

It's supposed to run

Code: Select all

nuRunPHPHidden('create_backup',0)

Re: Backup Procedure

Posted: Fri Nov 05, 2021 9:19 pm
by Mr71
Now works Kevin!!! Thanks!

Re: Backup Procedure

Posted: Fri Nov 26, 2021 10:34 am
by oli
Hello,
I tried to use the var $dump_file to get the filename but it seems this is not working for me.

Here's the value of "$dump_file" after creating a dump file (the file was created on the server):

Code: Select all

L21udC93ZWIxMDMvZDAvODIvNTcwMDg4Mi9odGRvY3Mvd2ViYXBwL2NvcmUvbGlicy9teXNxbGR1bXAvZHVtcHMvMTEtMjYtMjAyMV8wODozMjo0Ml9udUJ1aWxkZXJfYmFja3VwLnNxbC5nemlw
Any idea what I'm doing wrong here?

Thanks in advance,
Oli

Re: Backup Procedure

Posted: Fri Nov 26, 2021 11:07 am
by kev1n
It's base 64 encoded, try decoding it:

Code: Select all

base64_decode($dump_file);

Re: Backup Procedure

Posted: Sat Nov 27, 2021 12:13 pm
by oli
Thanks a lot kev!n !
kev1n wrote:It's base 64 encoded, try decoding it:

Code: Select all

base64_decode($dump_file);