vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   I'd ask Chen this but it's waaaaaaaaay beyond HIM... (https://vborg.vbsupport.ru/showthread.php?t=39734)

filburt1 06-11-2002 09:59 PM

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

?

Mark Hensler 06-12-2002 02:55 AM

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


Admin 06-12-2002 05:11 AM

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

(umm, there IS a problem with [code]... argh)

Mark Hensler 06-12-2002 08:38 PM

Ya, looks like its calling nl2br twice.

filburt1 06-12-2002 09:33 PM

Coolness...since this is running on my own system I can just schedule a batch file to be run every 12 hours or something?

XyuRi 06-13-2002 12:47 AM

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)

filburt1 06-14-2002 12:34 AM

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


Mark Hensler 06-14-2002 04:42 AM

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

mysql -uUser -pPassword -e "DELETE FROM table_name" database_name

Admin 06-14-2002 08:25 AM

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.


All times are GMT. The time now is 12:27 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.01039 seconds
  • Memory Usage 1,725KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete