Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBulletin Cron Based Database Backup Details »»
vBulletin Cron Based Database Backup
Version: 4.2.0.2, by Paul M Paul M is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.2.x Rating:
Released: 12-27-2009 Last Update: 11-25-2013 Installs: 1434
Uses Plugins
Additional Files Translations  
No support by the author.

As of 23 Nov 2017 this modification has been withdrawn.

This is a cut down version based on a backup system written by Trigunflame for vb 3.0. It is a simple vBulletin cron trigged php system that does a dump of your database - either as one complete file, or as one file per table. Especially useful now that IB removed the old ACP backup option in vBulletin 4. Files can be (G)Zipped to save space.

All the options are located in the ACP in vBulletin Options >> vBulletin Automatic Backup

To install, download and unzip the files, and follow the instructions in the text file.


History:

v4.0.1 : 28-Dec-2009 : Initial release for vb 4.0.0 Gold.
v4.0.2 : 29-Dec-2009 : Added ability to block process larger tables.
v4.0.3 : 27-Jun-2010 : Added Gzip option.

v4.1.0 : 04-Dec-2010 : Updated for vBulletin 4.1.0.

v4.1.7.0 : 16-Oct-2011 : Updated for vBulletin 4.1.7.

v4.2.0.0 : 24-May-2012 : Updated for vBulletin 4.2.0.
v4.2.0.1 : 17-Mar-2013 : Removed vboptions from backup call..
v4.2.0.2 : 25-Nov-2013 : Fix php 5.3 deprecated warnings, added mysqldump backup.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #502  
Old 08-04-2011, 11:23 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is no limit to the size it will process, if you get timeouts then you need to check php timeout settings and also mysql timeout settings.

That said, with a database that size, I would not rely on just this mod as a backup method.
Reply With Quote
  #503  
Old 08-08-2011, 07:03 AM
washingtonboise washingtonboise is offline
 
Join Date: Mar 2009
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have tried some other scripts like mysqldumper, and they are all timing out, probably mysql timeout.

I find it surprising that people are telling me I can log in to SSH, run a few commands (like five), and the server will make a perfect, fail-proof copy of the database.

Are scripts limited from using the same kind of commands like 'wget' that work so reliably in SSH? It's starting to look like I'm just going to have to buy a book and learn the shell commands.
Reply With Quote
  #504  
Old 08-08-2011, 12:50 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by washingtonboise View Post
I find it surprising that people are telling me I can log in to SSH, run a few commands (like five), and the server will make a perfect, fail-proof copy of the database.
This is correct, read up on "mysqldump"
Reply With Quote
  #505  
Old 08-08-2011, 02:50 PM
Hostboard's Avatar
Hostboard Hostboard is offline
 
Join Date: May 2002
Location: CT
Posts: 843
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Back in 08ish I wrote a Perl script that not only backed up the database but also the physical files. I ran it via CRON but it could also be manually envoked. You can use the single line in the code below noting the mysqldump as Paul mentioned. The code below will give you an idea of what you need to read about (mysqldump switches) to get a proper backup.

#!/usr/bin/perl
# System Backup
#------ Variables ------
$backupdir = "/usr/local/DirectoryOfBackUpLocation"; # "." for current
$other_dirs = "/usr/local/DirectoryToBeBackedUp1 /usr/local/DirectoryToBeBackedUp2";
#-----------------------
print "Backup Initiated...\n";
@timenow = localtime(time);
$newfilename = sprintf("%02d",$timenow[4]+1) .
sprintf("%02d",$timenow[3]) . ($timenow[5] + 1900);
print "Using Filename: $newfilename.sql \n";
print "Starting database backup... \n";
system "mysqldump -qce -r $newfilename.sql -u root DataBaseName";
print "Starting Compression... \n";
system "tar czf $backupdir/$newfilename.tar.gz $other_dirs $newfilename.sql";
unlink "$newfilename.sql" || print "Error: Cannot delete file specified: $newfilename - $_ \n";
print "Done. \n"


I use Paul's modification on ALL my sites and am surprised it is not a default VB option. As backups are critical if you run a site.

If I had any requests it would be to have an option to also include the physical files and auto purge backups X days old.
Reply With Quote
  #506  
Old 08-08-2011, 02:53 PM
cameraguru cameraguru is offline
 
Join Date: Aug 2011
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What a life saver a good backup can be!

Thanks
Reply With Quote
  #507  
Old 08-08-2011, 07:42 PM
grasshopper1983 grasshopper1983 is offline
 
Join Date: Jun 2010
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi paul

someting wrong here

It make a date folder in my backup folder... but its not wrinting the .sql files...

and still getting the Backup Error : Could not write to destination file

what i'm i doing wrong?

thanks
Reply With Quote
  #508  
Old 08-08-2011, 11:42 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That would be a permissions error.
Reply With Quote
  #509  
Old 08-09-2011, 01:02 PM
Hostboard's Avatar
Hostboard Hostboard is offline
 
Join Date: May 2002
Location: CT
Posts: 843
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by grasshopper1983 View Post
hi paul

someting wrong here

It make a date folder in my backup folder... but its not wrinting the .sql files...

and still getting the Backup Error : Could not write to destination file

what i'm i doing wrong?

thanks
CHMOD the backup folder to 777 Also make sure the backup folder is NOT in your websites directory but rather off of the root of your account.
Reply With Quote
  #510  
Old 08-18-2011, 11:20 AM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This may sound silly, but to get it to just backup every day of the week and overwrite the previous weeks files so it doesn't keep growing, do I change the field Y-m-d and put a lower case letter "L" l in that field?

Thanks ..

Regards,
Doug
Reply With Quote
  #511  
Old 08-18-2011, 02:13 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, that sounds about right.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:37 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10299 seconds
  • Memory Usage 2,325KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (14)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete