Go Back   vb.org Archive > Community Discussions > Forum and Server Management
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-22-2008, 04:46 PM
Auron Auron is offline
 
Join Date: Oct 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default database backup and archiving/removal

ok heres the deal.

lve finally managed to set up a PHP based cron, as my other cron method didnt work too well, basically the script l use is accessed backs up *ALL* databases on server, including one or two non-vb scripts databases.. however due to the size of the forum l run, the dumps get rather large, and l mean 200meg a pop which builds up over time.. (thankfully its being gziped now) however l want to remove files older than 60 days, in short l only want 60 days worth of archived databases (as my friend said if one of us is offline and the other is busy for more than a week or two as it happens there are older backups) anywho l came up with this after searching around.

find /path/to/backups -type f -name "*.gz" -ctime +60 -exec rm -v {} \;

would this command clean up all databases that were older than 60 days without touching those that were below 59 days old? (as far as lve worked it out this command would only touch files ending with .gz if my calculations are correct)
Reply With Quote
  #2  
Old 05-22-2008, 07:37 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

find /path/to/backups -type f -name "*.gz" -mtime +60 -exec rm -rf {} \;
Reply With Quote
  #3  
Old 05-23-2008, 11:52 AM
Auron Auron is offline
 
Join Date: Oct 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

seems lm back to square one again, l managed to work out the removal code for old backups... however the scripts that back up my databases fail

yesterday they worked today l get 500 errors off of them.

bascially after the forum cron script messed up l used another one that was planned to take over, the cron test worked with the following code

/usr/local/bin/php -q /home/account/public_html/sqlbackup/backup_dbs.php
the script basically creates a temp dir exports "ALL" databases on server, Gzips them and then Tars them all together, the above code was needed to get rid of all the backups that had not been edited or touched for more than 60 days...

l dont know what changed on server since last night, but its frustrating me because the moment something works the next day it doesnt, and all because l had to upgrade to truetype support for the 3.7.0 upgrade, which has left me with more server problems than l ever expected.
Reply With Quote
  #4  
Old 05-23-2008, 02:07 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If its a dedicated server, just use a cron file, no need to use a php based backup script.

If its a dedicated server, check the apache error_log file for the 500 message and find out why its failing, it could be something as simple as changing it to 755 from 644.
Reply With Quote
  #5  
Old 05-23-2008, 02:58 PM
Auron Auron is offline
 
Join Date: Oct 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

off to take a look now, had to do some digging for the file tho because when we asked the host to revert some changes made by WHM (which messed things up) they messed up the error log on cpanel.

will update the thread with my findings

--------------- Added [DATE]1211560034[/DATE] at [TIME]1211560034[/TIME] ---------------

looked in the error logs and l can find no mention of any error with it, hell l cant seem to find any 500 error in the error_log that relates to even myself manually clicking on the php file which resulted in a 500 error after executing.
Reply With Quote
  #6  
Old 05-23-2008, 06:11 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try checking the actual domainname log file, you may have to turn on debug as well.

typically 500 errors are related to a permission issue or a bad line in a htaccess file.
Reply With Quote
  #7  
Old 05-23-2008, 06:21 PM
Auron Auron is offline
 
Join Date: Oct 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lve partially resolved the issue but still have problems with the large dbs l have on server, the one over 200meg doesnt seem to want to export T_T
Reply With Quote
  #8  
Old 05-24-2008, 03:01 AM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, a 200mb db shouldnt have any issue exporting, so i would say its your script.

As i said, i would just set up a cron in /etc/cron.daily and quit using the php based script.
Reply With Quote
  #9  
Old 05-24-2008, 10:31 AM
Auron Auron is offline
 
Join Date: Oct 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

l was trying to use crontabs.

crontab - e

and edit thigns in like you would in cpanels based cron area..

the weird thing is the damn file wouldnt save giving me errors saying it wouldnt install >_<, l'll see what my host comes up with as a last ditch effort as to why the damn thing wont work if not l'll look for the cron.daily and weekly ones as those are all l need.

l take it the format is pretty much the same eg: ****** /command/to/run

and the method of editing and saving is the same too.

--------------- Added [DATE]1211629791[/DATE] at [TIME]1211629791[/TIME] ---------------

Quote:
Originally Posted by snakes1100 View Post
Well, a 200mb db shouldnt have any issue exporting, so i would say its your script.

As i said, i would just set up a cron in /etc/cron.daily and quit using the php based script.
lm using that script because it does all the databases, and its the only method l found which doesnt require me to make 9 crons (l have 9 different forums to backup along with their gallerys which is 2 dbs each)
Reply With Quote
  #10  
Old 05-25-2008, 01:22 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A simple cron script will dump all the db's as well in a single cmd, there is no need for 9 separate crons
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 04:25 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.04019 seconds
  • Memory Usage 2,250KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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