vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - Automatic Database Back-up (https://vborg.vbsupport.ru/showthread.php?t=114097)

Logikos 04-25-2006 10:00 PM

Automatic Database Back-up
 
Automatic Database Back-up



Keywords
Automatic, Database, Backup, Cron

What this does
This is a port of Brad's hack that can be found here. This will backup your database using the vBCron system in vBulletin and send the file to a directory that you specified in the vBulletin Options area.


IMPORTANT NOTE TO ALL THAT USE THIS SCRIPT
This script invokes an outside process that runs in the backround on your server to backup and compress your database. It is important to remember that this is not an instant process, do not enter you ftp as soon as the script says it is done and try to download your backup. It will likely be incomplete and your server will probbly still be writting the file to disk.

I ussally give the process an hour or two before I mess with the file, larger databases will take more time of course.

To do list...
  • Time to install: 5 minutes
  • Queries to run: 0
  • File Mods: 0
  • Templates to edit: 0
  • Templates to add: 0
  • New Phrases: 5
  • New Plugins: 0

Credits
Thanks to Brad for allowing me to port this.

Install This Product
Show your support and click the install button!

Testing Information
I've been using this for vBHackers.com since I first upgrade. I have all my backups being sent to a directory, outside of the public_html. I've yet to experiance any problems. I have had to use one of the backups before, and all worked well.

Product History
Wednesday, April 26, 2006 - Public Released

Help & Support
Before asking for support, please make sure you have done all the necessary changes! If you still need support, please post a reply here and double check that you have clicked the Install Button. I will try to support this hack the best I can. Support is not guaranteed!

Please post any bugs and errors here. Hope you like it, feedback is always welcomed! :)

Logikos 04-26-2006 08:31 AM

~ Post Reserved ~

Frapegliko 04-26-2006 08:36 AM

cool mod

apdcanari 04-26-2006 08:57 AM

Cool..but I have an error :

Automatic Database Back-up

Warning: exec() has been disabled for security reasons in /includes/cron/databack.php on line 21

Fait

Atakan KOC 04-26-2006 08:58 AM

Thanks LiveWire

Logikos 04-26-2006 09:02 AM

@ apdcanari: Your host has disabled that feature for security reasons. I suggest you contact your host. :)

@ Atakan KOC & Frapegliko: Thanks & No Problem! :)

apdcanari 04-26-2006 09:07 AM

Quote:

Originally Posted by LiveWire
@ apdcanari: Your host has disabled that feature for security reasons. I suggest you contact your host.

Ok, thanks.

My host is Informaniak

theArchitect 04-26-2006 11:55 AM

Forgive the nOObie question, but does this work using the same system as a SSH autobackup?

I have set-up a script, with a friends help on my server which takes care of my back-ups, but this hack could be useful for other site I work on where I don't have SSH access and can't set-up something similar to my system.

But I am very nervous of the AdminCP back-up system.

dacho 04-26-2006 01:11 PM

installed but there is a error problem
Code:

Warning: exec(): Unable to fork [mysqldump --add-drop-table -h192.000.000.000 -uXXXXX -XXXXX XXXXX 2>/XXXX/XXXX/forums.dacho.co.il/XXXX/04-26-2006-error.txt >/XXXX/XXXX/forums.dacho.co.il/XXXX/04-26-2006.sql] in \includes\cron\databack.php on line 21

Warning: exec(): Unable to fork [tar -cSz --remove-files -C/XXXX/XXXX/forums.dacho.co.il/XXXX -f/XXXX/XXXX/forums.dacho.co.il/XXXX/04-26-2006.tar.gz 04-26-2006.sql 04-26-2006-error.txt] in \includes\cron\databack.php on line 26


COBRAws 04-26-2006 02:49 PM

Quote:

Originally Posted by dacho
installed but there is a error problem
Code:

Warning: exec(): Unable to fork [mysqldump --add-drop-table -h192.000.000.000 -uXXXXX -XXXXX XXXXX 2>/XXXX/XXXX/forums.dacho.co.il/XXXX/04-26-2006-error.txt >/XXXX/XXXX/forums.dacho.co.il/XXXX/04-26-2006.sql] in \includes\cron\databack.php on line 21

Warning: exec(): Unable to fork [tar -cSz --remove-files -C/XXXX/XXXX/forums.dacho.co.il/XXXX -f/XXXX/XXXX/forums.dacho.co.il/XXXX/04-26-2006.tar.gz 04-26-2006.sql 04-26-2006-error.txt] in \includes\cron\databack.php on line 26


The dir path to your forums is -C/XXXX/XXXX/forums.dacho.co.il/XXXX ??


I think it is -C/XXXX/XXXX/dacho.co.il/XXXX/forums

Boofo 04-26-2006 02:51 PM

You have a directory in the zip that has a newer plug-in in it. Which files do we use, sir? ;)

Sooner95 04-26-2006 03:43 PM

installed, I used the first set.. hopefully that is it...

Boofo 04-26-2006 03:55 PM

Quote:

Originally Posted by Sooner95
installed, I used the first set.. hopefully that is it...

I used the ones in the second databack directory. The php file had a newer date on it. Shouldn't really matter, though. As long as it works. ;)

And it is working great on my site. ;)

The Chief 04-26-2006 04:06 PM

Looks great, might install when we really get in need of it ;)

Boofo 04-26-2006 04:21 PM

Quote:

Originally Posted by The Chief
Looks great, might install when we really get in need of it ;)

You should be in need of it now. It's always best to have a backup of the db close at hand and as new as possible. ;)

nvhlinh 04-26-2006 05:16 PM

I try to run the script in Sheduled Tasks and it creates a error-file with this error message:

mysqldump: Out of memory (Needed 661284 bytes)
mysqldump: Got error: 2008: MySQL client run out of memory when retrieving data from server

Snake 04-26-2006 05:55 PM

Do you have any screenshots if available?

Boofo 04-26-2006 06:23 PM

Quote:

Originally Posted by Lil Ripsta
Do you have any screenshots if available?

There's nothing to see. It just backs up your forum db at a set time via a cron job. ;)

Tefra 04-26-2006 06:48 PM

thank you, works great here too!

btw all dublicated files are the same exactly.

Boofo 04-26-2006 06:50 PM

Quote:

Originally Posted by Tefra
thank you, works great here too!

btw all files are the same exactly.

The xml files are 2 different sizes. The php file is the same. ;)

Logikos 04-26-2006 07:13 PM

Fixed the zip. Winzip was archiving duplacates for some strange reason.

Boofo 04-26-2006 07:15 PM

Quote:

Originally Posted by LiveWire
Fixed the zip. Winzip was archiving duplacates for some strange reason.

Which xml file did you keep? The zip I have had 2 different sized ones.

Logikos 04-26-2006 07:21 PM

Both XMLs are the same, the only diffrence was on of the XML files had an extra setting in the Admincp asking you for the name of the file that you want your backup to be called. That setting was a test I was trying, but I never added the code in the databack.php. So everything will work no matter which XML you used. You might just have an extra setting in the admincp that won't work anyways, because I deleted the code before I ever released it. :)

Boofo 04-26-2006 07:33 PM

Quote:

Originally Posted by LiveWire
Both XMLs are the same, the only diffrence was on of the XML files had an extra setting in the Admincp asking you for the name of the file that you want your backup to be called. That setting was a test I was trying, but I never added the code in the databack.php. So everything will work no matter which XML you used. You might just have an extra setting in the admincp that won't work anyways, because I deleted the code before I ever released it. :)

Actually, that might be a setting that would be good. On the same principal of renaming the admin and mod cp directories in the config.php file, if you get my meaning. ;)

Logikos 04-26-2006 07:37 PM

I was making it so it would be the name you selceted in the admincp, then the date. For example: vbhbackup-4-23-06.sql. They have to be unique names for when updating it each day, or they will over-right each other

CBE 04-26-2006 07:38 PM

hi all,,

where it saves the database back-up ??????

Logikos 04-26-2006 07:41 PM

You have the setting in the admincp. Go to Admincp => vBulletin Options => Database Backup Settigs => File Dump Path :)

Logikos 04-26-2006 07:43 PM

Adding a screenshot of the settings.

Boofo 04-26-2006 07:48 PM

Quote:

Originally Posted by LiveWire
I was making it so it would be the name you selceted in the admincp, then the date. For example: vbhbackup-4-23-06.sql. They have to be unique names for when updating it each day, or they will over-right each other

Couldn't you do a setting for the name if it is NOT an hourly backup? I backup once a week. I think that is more than enough and doesn't flood the directory with a lot of files of size. Most users won't do more than one backup a day, anyway. No real need to. ;)

Beller 04-26-2006 07:49 PM

Installed..You never know when you will need this one!

Logikos 04-26-2006 07:55 PM

I backup every 12 hours over-righting the old backup. Then I go to the directory once or twice a week and clean it up manually. Gotta have some work as an admin :p

Boofo 04-26-2006 08:00 PM

I'm sure I can figure out how to add the setting for it. ;)

Logikos 04-26-2006 08:01 PM

When you do, don't forget to share it with us. :p

puertoblack2003 04-26-2006 08:16 PM

Quote:

Originally Posted by nvhlinh
I try to run the script in Sheduled Tasks and it creates a error-file with this error message:

mysqldump: Out of memory (Needed 661284 bytes)
mysqldump: Got error: 2008: MySQL client run out of memory when retrieving data from server

even though i like the hack i can't installed it...i'm assuming you're with dreamhost...i send them an email because i had the same problem and this is there response hopr this can help...

Code:

Hello,

Your database is large at 124MB and we divide the server up into multiple
Mysql instances each with a 50MB memory limit. You will not be able to
backup the database on your own because of this. Dont worry though, we
backup the database for you every day.

Thanks!


Boofo 04-26-2006 08:36 PM

Quote:

Originally Posted by LiveWire
When you do, don't forget to share it with us. :p

You already had the setting there, editing the php file is all that it should take.

bashy 04-26-2006 08:36 PM

Hi peeps

This dont appear to be working for m8 :(
It says

Automatic Database Back-up

Done

yet the folder is empty, I have manually ran this about 5 tims now pmsl..

The php is in the cron directory....
I do have the correct path to the file, found using the php info

Perhaps i will have about 5 in the dir in the morning lol

Baffled me is :)

Boofo 04-26-2006 08:40 PM

Quote:

Originally Posted by bashy
Hi peeps

This dont appear to be working for m8 :(
It says

Automatic Database Back-up

Done

yet the folder is empty, I have manually ran this about 5 tims now pmsl..

The php is in the cron directory....
I do have the correct path to the file, found using the php info

Perhaps i will have about 5 in the dir in the morning lol

Baffled me is :)

Did you chmod the directory to 777 like it says to?

shadowdancer36 04-26-2006 11:34 PM

Where are the options at that you show in your screen shot? I've looked all over and haven't seen it.

I think this is a great idea. You think you can add a way to send out a message to users online saying system maintence is bout to happen, blah blah blah... and disable the board until the download is complete? Then bring it back up and notify the admin that it is done? Makes me think back to the old days of BBSin when TAG or Teleguard did it's tasks.

Boofo 04-27-2006 01:45 AM

Look in the vBulletin Options under Database Backup Settings. ;)

Zidane007nl 04-27-2006 02:53 PM

Installed it without problems. Great job. That will hopefully protect me more from my forum being hacked...


All times are GMT. The time now is 07:05 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01395 seconds
  • Memory Usage 1,828KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete