homepage Welcome to WebmasterWorld Guest from 54.166.122.65
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
automatic restore of a database every hour
David_M

10+ Year Member



 
Msg#: 3684890 posted 6:09 am on Jun 27, 2008 (gmt 0)

For a demo site:
Does anyone know of a simple php script which will restore my PHPBB3 database and settings every hour?

PHPBB3 has a built in restore function, I'm wondering if there's a way to trigger it with a cron job.

Thanks.

 

eelixduppy

WebmasterWorld Senior Member eelixduppy us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3684890 posted 3:59 am on Jun 28, 2008 (gmt 0)

There probably IS a way to execute that script with a cron. Have you tried it yet? You might have to write up your own little script real quick to properly use the restore feature without the forms that come with phpbb, however.

Also, if you don't mind me asking, what is the purpose of restoring the database every hour? How often does this actually need to happen?

David_M

10+ Year Member



 
Msg#: 3684890 posted 5:42 am on Jun 28, 2008 (gmt 0)

Every hour is not a requirement- just to eliminate spam posts or changes to the demo users.

David_M

10+ Year Member



 
Msg#: 3684890 posted 12:34 am on Jun 29, 2008 (gmt 0)

How about a script which will take my .sql file, and overwrite an existing database with it?

eelixduppy

WebmasterWorld Senior Member eelixduppy us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3684890 posted 9:18 pm on Jun 29, 2008 (gmt 0)

Create a .SQL file with the backup from a previous time, then run a cron with the command:

mysql < backup.sql

David_M

10+ Year Member



 
Msg#: 3684890 posted 1:14 am on Jun 30, 2008 (gmt 0)

mysql -uUSERNAME -pPASSWORD DATABASE < /home/mysite/public_html/store/backup.sql

Worked :)

Thanks.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved