Jump to content

Automated Database Backup (option #2)


Recommended Posts

This script finds all of the MySQL databases on your server if using the root user account, or just the databases associtated with the MySQL username, individually backs them up (for easy recovery of specific data), compresses them, and stores the file(s) in a specified directory and/or emails it to you. Very configurable.

 

zip file contains:

 

backup_dbs.php = encrypted core script file

backup_dbs_config.php = configuration file

lock.php = required encryption key file

readme.txt

 

(Core script is encrypted and will be released to Matt if he would like to incorporate into WHMCS)

 

Can be executed via www or cron...

 

Example output when script runs:

 

2007-03-16 22:23:42: Executing MySQL Backup Script v1.4

2007-03-16 22:23:42: Processing Databases..

2007-03-16 22:23:42: Dumped DB: user_mysqldb

2007-03-16 22:23:43: Compressed DB: user_mysqldb

2007-03-16 22:23:43: Archiving files..

2007-03-16 22:23:43: Backup complete!

2007-03-16 22:23:43: Emailing backup to user@domain.com ..

 

DISCLAIMER

 

This script has been tested extensively, but I take no responsibility for any damages caused by misuse, improper configuration, or differences in server configurations.

 

DOWNLOAD HERE

Link to comment
Share on other sites

  • 1 month later...

Hi, I am getting this error below when trying to run this script from browser, any ideas on what I could be doing wrong? I think I have given correct file permissions (chmod the lock file to 777 as it requested. (I have changed 'myusername' below for this post).

 


[b]Warning[/b]:  is_dir() [[url='function.is-dir']function.is-dir[/url]]: open_basedir restriction in effect. File(/db_backups) is not within the allowed path(s): (/home/myusername:/usr/lib/php:/usr/local/lib/php:/tmp) in [b]/home/myusername/public_html/script/lock.php(5) : eval()'d code(1) : eval()'d code(1) : eval()'d code[/b] on line [b]149[/b]



[b]Warning[/b]:  mkdir() [[url='function.mkdir']function.mkdir[/url]]: open_basedir restriction in effect. File(/db_backups) is not within the allowed path(s): (/home/myusername:/usr/lib/php:/usr/local/lib/php:/tmp) in [b]/home/myusername/public_html/script/lock.php(5) : eval()'d code(1) : eval()'d code(1) : eval()'d code[/b] on line [b]150[/b]



[b]Notice[/b]:  Undefined index:  f_log in [b]/home/myusername/public_html/script/lock.php(5) : eval()'d code(1) : eval()'d code(1) : eval()'d code[/b] on line [b]80[/b]

Backup directory could not be created in /db_backups


[b]Notice[/b]:  Undefined index:  f_err in [b]/home/myusername/public_html/script/lock.php(5) : eval()'d code(1) : eval()'d code(1) : eval()'d code[/b] on line [b]80[/b]

Backup directory could not be created in /db_backups
Backup directory could not be created in /db_backups

Link to comment
Share on other sites

Hey,

 

You have open_basedir enabled, meaning you can't have PHP scripts go outside your /home/user folder. You would have to disable open_basedir for that account. You can find this in root WHM, under security tweaks.

 

From,

Adam

Link to comment
Share on other sites

Thanks for that Adam, what you said made me realise what I was doing wrong and was so simple. . . all that was missing was /home/myusername/public_html/db_backups

 

Now works like a dream and has emailed me a backup :D

 

Cheers and thanks also goes to 'webresellers' for this great script

Mick

Link to comment
Share on other sites

  • 3 months later...

I'm getting these errors..

 

Executing MySQL Backup Script v1.4

Processing Databases..

DUMP FAILED

 

DUMP FAILED

 

COMPRESSION FAILED

 

COMPRESSION FAILED

 

DUMP FAILED

 

DUMP FAILED

 

COMPRESSION FAILED

 

COMPRESSION FAILED

 

Any ideas?

 

The username and password are fine..

Link to comment
Share on other sites

  • 3 months later...
  • 3 years later...

Dear webreseller,

 

Thank you very much for your script, but i wonder why you have it encrypted ? i could not trust any encrypted (non-official) script.

 

could somebody confirm that the script is clean before we use it ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated