Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
[vbcron] Automatic database backup [v1.3] Details »
[vbcron] Automatic database backup [v1.3]
Mod Version: 1.00, by Brad (Contributor) Brad is offline
Developer Last Online: Feb 2020 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.0 Rating: (1 vote - 5.00 average) Installs: 73
Released: 04 Mar 2004 Last Update: Never Downloads: 50
Not Supported Re-usable Code Translations  

This script will allow you to automaticly back-up your vBulletin database (or any database you have access to).


Current Stable Version: 1.3.1

System Requirements-

vBulletin RC 2 or later
Unix/Linux server with MySQL Dump support
Ability to chmod folders to 777 (775 works on some servers)

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.

Installing the script-

1. You will need to change the information here for it to work correctly on your server:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

2. CHMOD the folder you specified in DUMP_PATH to 777

3. Upload the vbcron_db_backup_131.php file to the /vbroot/includes/cron directory

4. Enter you admin control panel, under Scheduled Tasks click Add New Scheduled Task

Enter the information has follows:

Title: Automatic Database Back-up

Day of the Week:

This is the day of the week the task should run on. Set this to * to have it not apply, or for it to run every day (if Day of the Month is set to * below). Otherwise select a specific day. Note that this will override the day of the month option, unless this is set to *.

Day of the Month:
Set this to the specific day of the month the task should run. This is overridden by the Day of the Week setting above. Set this to * to have it not apply.

Hour:
This is the hour of the day the task should run. Set it to * to have it run every hour.

Minute:
This is the minute of the hour the task should run. Set it to * to have it run every minute (not really recommended!).

Log Actions:
If this is set to Yes, every time the scheduled task runs, a log will be made indicating that the task was run, and in certain cases, additional information will be provided (e.g. for the Birthday Email task, the usernames who were sent birthday wishes will be noted).

Filename:
Enter the path to vbcron_db_backup_131.php, ./includes/cron/vbcron_db_backup_131.php should work in most cases

What was added in 1.3.1

- Fixed all bugs reported in 1.3

What was added in 1.3

- Added ability for script to leave logs

Improvments to come:

- Email alert when db is begin backed up
- Close board when back-up is in process
- 'Lock down' db durring backup so no one can access it
- Table, by table back-up
- Clear session table before backup
- Make script more windows friendly
- Delete last .sql (or .tar.gz) file when doing current back-up
- Ability to use hashed file names for back-ups
- Save back-up to forgin server

To come: version 2.0

2.0 will introduce most, if not all the fetures listed above.

Public beta testing will begin in the next few days, expect a stable version in at least 2 weeks time.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 04 Mar 2004, 06:50
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
How do we find out if we have MySQLdump on our server?
Reply With Quote
  #3  
Old 04 Mar 2004, 07:38
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Originally Posted by Boofo
How do we find out if we have MySQLdump on our server?
You can connect via SSH/telnet and try a mysqldump command from the CLI ...
__________________
Natcher00
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{DaniWeb: Learn HOW-TO mod_rewrite your vB board}
Reply With Quote
  #4  
Old 04 Mar 2004, 07:48
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Brad: you have a couple of Parse errors ... missing ";"'s in the DEFINE area ...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Both need those pesky ;'s

EDIT: //

Also on the last line it should look like this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

as you have a couple of extra bits you don't need ...

worked fine after that

Great idea!
__________________
Natcher00
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{DaniWeb: Learn HOW-TO mod_rewrite your vB board}

Last edited by Natch; 04 Mar 2004 at 07:52.
Reply With Quote
  #5  
Old 04 Mar 2004, 07:58
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
One suggestion as an improvement ...

Include the facility to make this script also tar.gz the resultant SQL dump file, for compactness ...
__________________
Natcher00
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{DaniWeb: Learn HOW-TO mod_rewrite your vB board}
Reply With Quote
  #6  
Old 04 Mar 2004, 11:06
Pikok Pikok is offline
 
Join Date: Jul 2002
Originally Posted by Natch
One suggestion as an improvement ...

Include the facility to make this script also tar.gz the resultant SQL dump file, for compactness ...
I think you should be able to do that with this..

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #7  
Old 04 Mar 2004, 11:08
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Wheee - thanks
__________________
Natcher00
... is the Admin @ MobileForces.org - Official Community for a cult Vehicle based FPS - the only place for support!
... also he's Penfold to Dark_Wizard's Danger Mouse in development of vBWar
http://www.mobileforces.org/sig.jpg
{DaniWeb: Learn HOW-TO mod_rewrite your vB board}
Reply With Quote
  #8  
Old 04 Mar 2004, 14:36
Brad Brad is offline
 
Join Date: Nov 2001
Natch sorry about that, I coded this real late , ill fix the zip.

Pikok, ill add that to the file to, and probbly some more compresstion methods over time
Reply With Quote
  #9  
Old 04 Mar 2004, 14:54
M1th's Avatar
M1th M1th is offline
 
Join Date: Jul 2002
Looks good, thanks Brad!
__________________
Chamber of Secrets - The Ultimate Harry Potter Community!
Reply With Quote
  #10  
Old 04 Mar 2004, 15:07
M1th's Avatar
M1th M1th is offline
 
Join Date: Jul 2002
er... sorry for double posting. Just wondering, what is the difference between --opt and --add-drop-table?
__________________
Chamber of Secrets - The Ultimate Harry Potter Community!

Last edited by M1th; 04 Mar 2004 at 15:09.
Reply With Quote
  #11  
Old 04 Mar 2004, 16:22
mOdEtWo mOdEtWo is offline
 
Join Date: Dec 2003
Thumbs up

This is a great hack, I'll install this one.

Also, good suggestion, Natch. I was on my way to request something like this. A sql file takes up lots of space when the forum is large (we have around 80,000 now), so making it a tar.gz is making the file compact and downloadable.

Yay! Best hack so far!



EDIT: A suggestion. What about the script being able to disable the boards and display a "We're doing database maintenance, come back in 10 minutes" type of message? Is this possible?

Also, I get a Fatal error: Call to undefined function: query() in /var/www/vb3/includes/functions.php on line 501 error message once the script is done. What does it mean?

Last edited by mOdEtWo; 04 Mar 2004 at 16:50.
Reply With Quote
  #12  
Old 04 Mar 2004, 16:24
mharmon mharmon is offline
 
Join Date: Feb 2003
This worked great.. a few questions though -- Will it overwrite the old dump each day?
Also -- it also wrote an XXXXXXXX-error.txt file along with the dump but it's empty.
Reply With Quote
  #13  
Old 04 Mar 2004, 16:31
Fi_InCogNiTo Fi_InCogNiTo is offline
 
Join Date: Jan 2003
Worked great on RC4. Also worked with the tar.gz

Thanks =D
Reply With Quote
  #14  
Old 04 Mar 2004, 16:48
mOdEtWo mOdEtWo is offline
 
Join Date: Dec 2003
Originally Posted by mharmon
This worked great.. a few questions though -- Will it overwrite the old dump each day?
Also -- it also wrote an XXXXXXXX-error.txt file along with the dump but it's empty.
this file, and the sql file, is deleted once the tar.gz process is finished.
Reply With Quote
  #15  
Old 04 Mar 2004, 19:36
Ryan Ashbrook's Avatar
Ryan Ashbrook Ryan Ashbrook is offline
 
Join Date: Dec 2002
Exactly what I was looking for! Thank you!
__________________
Ryan Ashbrook
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 14:52.

Layout Options | Width: Wide Color: