FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Scheduled backups
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Scheduled backups [message #5623] Tue, 10 September 2002 19:17 Go to next message
smeghead is currently offline  smeghead   Canada
Messages: 9
Registered: September 2002
Karma: 0
Junior Member
Is there a way to automate the data dump process. I would like to use Cron to do a nightly backup of my forum. I was thinking of using wget to request the URL that corresponds to doing a data dump, but I'm not sure how to handle authentication.

Has anybody done this? If so, could you give some pointers please?
Re: Scheduled backups [message #5627 is a reply to message #5623] Tue, 10 September 2002 19:59 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
wget will work, but you would need to pass some parameters via GET such as the archive name and a session id of an admin account, since that form will not work for any user who is not an admin.


FUDforum Core Developer
Re: Scheduled backups [message #5644 is a reply to message #5627] Wed, 11 September 2002 16:27 Go to previous messageGo to next message
smeghead is currently offline  smeghead   Canada
Messages: 9
Registered: September 2002
Karma: 0
Junior Member
Is the session id a transient thing? i.e. can it be used in a script and be valid indefinately or will it expire after a while?

It would be really helpful to have a way to send scripted admin commands. For example, on the front page of my forum I embed the lated Dilbert cartoon, which is pulled down by a script at midnite each night. However, in order for it to show up I have to manually go in and rebuild the theme. Is there a way to do this automatically or via a script?
Re: Scheduled backups [message #5646 is a reply to message #5644] Wed, 11 September 2002 16:54 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Session will expire after a while.

Since a backup script is something that people may be interested to run in a cron I'll modify the the source code to allow the form to authenticate the user by using HTTP AUTH. Thus making it easy for your to script the backup process in a cronjob using wget or simular tools.


As for cartoon thing, you are simply not doing something correctly if you need to rebuild the them each time. Had I wanted to do the same thing, I would fetch the cartoon in a cronjob saving the file as date + special script, ex. dilbert_20020911.jpg.
Then have a symlink to this image like dilbert_current.jpg, my forum would then link to dilbert_current.jpgm, which would always be the latest cartoon. All very nice and simple Smile


FUDforum Core Developer
Re: Scheduled backups [message #5649 is a reply to message #5646] Wed, 11 September 2002 18:04 Go to previous messageGo to next message
smeghead is currently offline  smeghead   Canada
Messages: 9
Registered: September 2002
Karma: 0
Junior Member
prottoss wrote on Wed, 11 September 2002 12:54

Session will expire after a while.

Since a backup script is something that people may be interested to run in a cron I'll modify the the source code to allow the form to authenticate the user by using HTTP AUTH. Thus making it easy for your to script the backup process in a cronjob using wget or simular tools.


Great! That will really help Smile

Quote:


As for cartoon thing, you are simply not doing something correctly if you need to rebuild the them each time. Had I wanted to do the same thing, I would fetch the cartoon in a cronjob saving the file as date + special script, ex. dilbert_20020911.jpg.
Then have a symlink to this image like dilbert_current.jpg, my forum would then link to dilbert_current.jpgm, which would always be the latest cartoon. All very nice and simple Smile


The way I did it was to download the cartoon to the /tmp directory, then copy it on top of /var/www/forum/thm/default/images/todaysdilbert.gif. This file is referenced in the index.tmpl file using an img tag. Is this a bad way to do it?
Re: Scheduled backups [message #5651 is a reply to message #5649] Wed, 11 September 2002 18:07 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
That is not a good approach, since it requires the theme to be rebuilt for this to 'go live' Why not just copy the file directly to theme/default/images/ inside WWW_ROOT dir? That way you avoid the rebuild theme step.

FUDforum Core Developer
Re: Scheduled backups [message #5652 is a reply to message #5651] Wed, 11 September 2002 18:41 Go to previous messageGo to next message
smeghead is currently offline  smeghead   Canada
Messages: 9
Registered: September 2002
Karma: 0
Junior Member
prottoss wrote on Wed, 11 September 2002 14:07

Why not just copy the file directly to theme/default/images/ inside WWW_ROOT dir? That way you avoid the rebuild theme step.


I don't understand - isn't that the same as I just said? I'm obviously missing something - could you please clarify?
Re: Scheduled backups [message #5654 is a reply to message #5652] Wed, 11 September 2002 19:22 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
nope you copied the file into thm/ directory i said to copy the file into the theme/ directory Smile

the thm/ contains the NOT YET COMPILED files, where the theme/ already contains the compiled data.


FUDforum Core Developer
Re: Scheduled backups [message #5658 is a reply to message #5654] Wed, 11 September 2002 19:53 Go to previous messageGo to next message
smeghead is currently offline  smeghead   Canada
Messages: 9
Registered: September 2002
Karma: 0
Junior Member
Got it Smile That did the trick, thanks.

BTW - since I'm new here, I'd just like to add my voice to the chorus and say how impressed I am with this software. You have done/are doing a great job and have created a wonderful system. Thanks for all your hard work.
Re: Scheduled backups [message #5723 is a reply to message #5623] Sun, 15 September 2002 23:07 Go to previous messageGo to next message
sdefranc is currently offline  sdefranc   Australia
Messages: 28
Registered: May 2002
Location: Australia
Karma: 0
Junior Member

I plan to look at ripping the backup portion out of the .php file and creating a script using the command line php executable to enable running backups from cron. If I come up with something I'll post back here.
Re: Scheduled backups [message #5724 is a reply to message #5723] Sun, 15 September 2002 23:40 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I already wrote an example in the manual an example that would workeable once 2.3.2 comes out. It is made possible by the fact that backup script now accepts HTTP Auth.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Insert a Forum-Specific logotype
Next Topic: Question about FUDForum & Permissions
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 15:06:05 GMT 2024

Total time taken to generate the page: 0.02861 seconds