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 - vBulletin Cron Based Database Backup (https://vborg.vbsupport.ru/showthread.php?t=231481)

Paul M 08-04-2011 11:23 AM

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.

washingtonboise 08-08-2011 07:03 AM

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.

Paul M 08-08-2011 12:50 PM

Quote:

Originally Posted by washingtonboise (Post 2230797)
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" :)

Hostboard 08-08-2011 02:50 PM

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.

cameraguru 08-08-2011 02:53 PM

What a life saver a good backup can be!

Thanks

grasshopper1983 08-08-2011 07:42 PM

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

Paul M 08-08-2011 11:42 PM

That would be a permissions error.

Hostboard 08-09-2011 01:02 PM

Quote:

Originally Posted by grasshopper1983 (Post 2231018)
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.

BadgerDog 08-18-2011 11:20 AM

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

Paul M 08-18-2011 02:13 PM

Yep, that sounds about right.


All times are GMT. The time now is 05:43 PM.

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.01613 seconds
  • Memory Usage 1,741KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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