Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2002, 09:59 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default I'd ask Chen this but it's waaaaaaaaay beyond HIM...

I have a demo board that I use to show off vB Lite. Every 12 hours or so, how can I have the board automatically reset itself? I mean:

1. Empty the entire db
2. Import the original, fresh install db from a .sql file

?
Reply With Quote
  #2  
Old 06-12-2002, 02:55 AM
Mark Hensler's Avatar
Mark Hensler Mark Hensler is offline
 
Join Date: Oct 2001
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I doubt it's beyond Chen.

Have a cron job fire off a shell script. Something like this...
Code:
#!/bin/sh

/path/to/mysql -uUser -pPassword -e "DELETE FROM table_name"
/path/to/mysql -uUser -pPassword -e "DELETE FROM table_name2"

/path/to/mysqlimport -uUser -pPassword database_name file_name.sql
Reply With Quote
  #3  
Old 06-12-2002, 05:11 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Or if you have root access, DROP DATABASE, CREATE DATABASE and load the file.

(umm, there IS a problem with [code]... argh)
Reply With Quote
  #4  
Old 06-12-2002, 08:38 PM
Mark Hensler's Avatar
Mark Hensler Mark Hensler is offline
 
Join Date: Oct 2001
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ya, looks like its calling nl2br twice.
Reply With Quote
  #5  
Old 06-12-2002, 09:33 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Coolness...since this is running on my own system I can just schedule a batch file to be run every 12 hours or something?
Reply With Quote
  #6  
Old 06-13-2002, 12:47 AM
XyuRi XyuRi is offline
 
Join Date: Jun 2002
Location: Australia
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by filburt1
Coolness...since this is running on my own system I can just schedule a batch file to be run every 12 hours or something?
that'd probably be the best option (thats probably yhr aproach I'd take)
Reply With Quote
  #7  
Old 06-14-2002, 12:34 AM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This little batch file doesn't work:

Code:
@echo off
echo Resetting vB Lite Demo Board on localhost...
c:
cd \mysql\bin
mysql -uroot -e "DELETE FROM vblite"
mysqlimport -uroot vblite \vblite.sql
echo Reset complete
Output:
Code:
C:\>resvblite
Resetting vB Lite Demo Board on localhost...
ERROR 1046 at line 1: No Database Selected
mysqlimport: Error: Table 'vblite.vblite' doesn't exist, when using table: vblite
Reset complete
Reply With Quote
  #8  
Old 06-14-2002, 04:42 AM
Mark Hensler's Avatar
Mark Hensler Mark Hensler is offline
 
Join Date: Oct 2001
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I gave you the wrong syntax... sorry

mysql -uUser -pPassword -e "DELETE FROM table_name" database_name
Reply With Quote
  #9  
Old 06-14-2002, 08:25 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Or just put EVERYTHING in the vblite.sql file...
Start it with:
[sql]USE database_name;[/sql]
Then proceed with the DELETE FROM queries, and then the import queries.
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 07:48 PM.


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.04487 seconds
  • Memory Usage 2,236KB
  • 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
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete