1
Peekay
Reset database script - like the new demo site?
  • 2005/6/26 23:46

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I noticed that Bluenova has kindly set up a new module testing site at:

http://xoopsmods.mmwebsites.com/

This is a nice resource, but it also caught my eye because it resets itself every hour.

Does anyone have a link to a tutorial and Cron script for resetting a demo site database back to it's default state periodically?. My host has nothing like that.
A thread is for life. Not just for Christmas.

2
jdseymour
Re: Reset database script - like the new demo site?

It is just two articles on my site.

Regular Database Backup With Cron (Updated)

This is a script to get the snapshot of your database.

Then:

MySQL Database Restore

This can be run from cron to restore the snapshot.

HTH.

3
giba
Re: Reset database script - like the new demo site?
  • 2005/6/27 3:39

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


Explend , great articles

Congratz John Seymour

4
bluenova
Re: Reset database script - like the new demo site?

Yup, they certainly work well

5
Peekay
Re: Reset database script - like the new demo site?
  • 2005/6/27 7:57

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Perfect! Many thx jdseymour.

One small question. You draw attention to the importance of the '<' in the MySQL restore script, but you missed out
<filename.sql
from that script. Do you just tag this on the end after 'full_database_name'?
A thread is for life. Not just for Christmas.

6
jdseymour
Re: Reset database script - like the new demo site?

">" is a unix tag to move the output to a file, in this case filename.sql. "<" is to read the file, in this case again, filename.sql. Of course the files name can be any that you want.

On windows systems the syntax is "-r filename.sql" or
"--result-file=filename.sql"

Hope this clarifies some.

7
Peekay
Re: Reset database script - like the new demo site?
  • 2005/6/27 8:16

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Hi. It's just that that it's missing from the script. I'm assuming it gets tagged on the end?

Script says:
mysql --host=database host IP --user=username --password=password --database full_database_name


should it be:
mysql --host=database host IP --user=username --password=password --database full_database_name <filename.sql
A thread is for life. Not just for Christmas.

8
jdseymour
Re: Reset database script - like the new demo site?

Yes it does. I will fix it thanks. Must have been a grey moment.

9
Peekay
Re: Reset database script - like the new demo site?
  • 2005/6/27 8:23

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


No worries!. Thx again.
A thread is for life. Not just for Christmas.

Login

Who's Online

474 user(s) are online (76 user(s) are browsing Support Forums)


Members: 0


Guests: 474


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits