Demo site file restore? - SOLVED!

General questions relating to Joomla! There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
ranwilli
Joomla! Master
Joomla! Master
Posts: 19053
Joined: Sun Feb 19, 2006 6:47 pm
Location: Toledo, OH
Contact:

Demo site file restore? - SOLVED!

Postby ranwilli » Sat Sep 29, 2007 4:02 am

I'm needing to do a demo site, and want to restore the site on an hourly basis because we'll be allowing Super Admin access.

I found a couple of threads here that address restoring the db (which were a God-send) but I haven't found anything relating to auto-restoring the complete file set.

Anybody know a reliable way to do that? (actually, ANY way to do that, I'll worry about reliable later.)
Last edited by ranwilli on Sun Sep 30, 2007 9:30 am, edited 1 time in total.
Don't HACK the Joomla! core. Extend and Override.
Stay ON the update path.
http://harpervance.com

whitewidower
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Wed Sep 26, 2007 11:28 pm
Location: USA
Contact:

Re: Demo site file restore?

Postby whitewidower » Sat Sep 29, 2007 4:09 am

couldn't you just cron a simple script that copies and places specific files from a storage directory?

User avatar
ranwilli
Joomla! Master
Joomla! Master
Posts: 19053
Joined: Sun Feb 19, 2006 6:47 pm
Location: Toledo, OH
Contact:

Re: Demo site file restore?

Postby ranwilli » Sat Sep 29, 2007 4:12 am

whitewidower wrote:couldn't you just cron a simple script that copies and places specific files from a storage directory?


uhhh, I guess I could, but honestly, I never did anything like that, and don't know where to begin. (I can set up a storage directory with the proper files, of course)

I guess it's time to dust off the php book and do some reading. :-[
Last edited by ranwilli on Sat Sep 29, 2007 4:15 am, edited 1 time in total.
Don't HACK the Joomla! core. Extend and Override.
Stay ON the update path.
http://harpervance.com

whitewidower
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Wed Sep 26, 2007 11:28 pm
Location: USA
Contact:

Re: Demo site file restore?

Postby whitewidower » Sat Sep 29, 2007 4:19 am

Here ya go.
This should get you started.

  $source = "./test.txt";
  $destination = "./copy.txt";
               
  if(copy($source, $destination)) {
      echo "File copied successfully.", "\n";
  } else {
      echo "The specified file could not be copied. Please try again.", "\n";
  }
             
?>

User avatar
donnan
Joomla! Ace
Joomla! Ace
Posts: 1348
Joined: Sat Jun 30, 2007 1:23 am
Location: Sydney, Australia
Contact:

Re: Demo site file restore?

Postby donnan » Sat Sep 29, 2007 4:29 am

I have a neat little cron script that you can call any page from a cron job set time.

Let me know if you need it.

Cheers
Paul

User avatar
ranwilli
Joomla! Master
Joomla! Master
Posts: 19053
Joined: Sun Feb 19, 2006 6:47 pm
Location: Toledo, OH
Contact:

Re: Demo site file restore?

Postby ranwilli » Sat Sep 29, 2007 4:34 am

Thanks, guys, I appreciate it, but

whitewidower wrote:...

  $source = "./test.txt";
  $destination = "./copy.txt";
               
  if(copy($source, $destination)) {
      echo "File copied successfully.", "\n";
  } else {
      echo "The specified file could not be copied. Please try again.", "\n";
  }
             
?>

I want to restore the entire Joomla fileset, can I do something like the old dos "copy c:/source/*.* c:/target " ?
Do I need to delete the fileset in the target area first?

Sorry if these are dumb!@# questions, I have always worked with a GUI on the linux server, wouldn't know the command line if it bit me.
Last edited by ranwilli on Sat Sep 29, 2007 4:37 am, edited 1 time in total.
Don't HACK the Joomla! core. Extend and Override.
Stay ON the update path.
http://harpervance.com

User avatar
donnan
Joomla! Ace
Joomla! Ace
Posts: 1348
Joined: Sat Jun 30, 2007 1:23 am
Location: Sydney, Australia
Contact:

Re: Demo site file restore?

Postby donnan » Sat Sep 29, 2007 4:43 am

Can I ask a silly question?

Why would you need to change the complete fileset.  Is this to avoid any possibility of the files being hacked into?

I would have thought you would just need to delete the contents from the database.

Mate....what is your msn or yahoo messenger id?

Give me a yell over msn or yahoo messenger if you wanna chat about it. My handle is paul_askme2001'at'yahoo.com replace 'at' with @

Cheers
Paul

whitewidower
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Wed Sep 26, 2007 11:28 pm
Location: USA
Contact:

Re: Demo site file restore?

Postby whitewidower » Sat Sep 29, 2007 4:58 am

I was wondering the same thing. Perhaps just copy config files.
I guess some will change template css and such though.

But this will do what you are looking for.
Set the directory variable to your main storage directory.

http://fijiwebdesign.com/content/view/81/

User avatar
ranwilli
Joomla! Master
Joomla! Master
Posts: 19053
Joined: Sun Feb 19, 2006 6:47 pm
Location: Toledo, OH
Contact:

Re: Demo site file restore?

Postby ranwilli » Sat Sep 29, 2007 6:01 am

Thanks a lot! that should do nicely.

Since we're giving SuperAdmin, and there's gonna be a functioning copy of JoomlaXplorer and the PU database manager on board, we figure we'll redo it every hour, and sooner or later the script kiddies will go bother someone else.
Don't HACK the Joomla! core. Extend and Override.
Stay ON the update path.
http://harpervance.com

User avatar
kerman
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Apr 05, 2007 10:47 pm
Location: Spain
Contact:

Re: Demo site file restore? - SOLVED!

Postby kerman » Sun Oct 07, 2007 11:01 am

Hi!

HAve anyone a ssh script to make this? I want to overwrite the entire httpdocs folder.

Thanks!

Edit: And if we can extract a gzip file directly to the folder, it will be great!!!

johnkelly1900
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Feb 10, 2013 8:11 am

Re: Demo site file restore? - SOLVED!

Postby johnkelly1900 » Fri Mar 11, 2016 4:50 am

I have a neat little cron script that you can call any page from a cron job set time.

Let me know if you need it.

Cheers
Paul


Could you please post this little cron script. I would like to check it out.


Return to “General Questions - 1.0.x”

Who is online

Users browsing this forum: No registered users and 5 guests