This is not really a Moodle question, I guess. Can anyone recommend a simple PHP script that one can use to zip up and download the Moodle data directory to one's hard drive? It's for a colleague at another school who is starting out and really wants to back this directory up on a regular basis.
Thanks,
Art
I guess that some sort of ftp client with automation might be able to do this. How about
http://www.robo-ftp.com
http://www.robo-ftp.com/img/sw_step4.png
Tim
Dear Art,
The answer to your colleguge's backup dreams is here
http://moodle.org/mod/forum/discuss.php?d=11739
courtesy of Jan Dierckx
Tim
That looks very promising, Tim.
If I understand what I have read, I have to install the program dbsender on the server, then I have to install the program WGET on my friend's computer.
Then, I customize this and save it as xyz.cmd:
wget -o log.txt -np -m ftp://username:password@www.olvrode.be/private/moodledata
wget ww.olvrode.be/moodle/admin/dbsender.php
Is that really correct? Or am I just totally confused?
Thanks,
Art
Art,
You're right: the dbsender.php program resides on the server. The only thing it does is mail out a zipped copy of the complete Moodle database.
The script needs a bit of configuration: you have to add database name, username, password, the emailaddress it needs to mail to, etc... the same things one would enter during Moodle install.
WGET would indeed be installed on your friend's computer. It' s just an easy way to download the moodle data directory, because if you invoke the program with the -m parameter (m for mirror), it only downloads the files that have changed since the last time.
The script xyz.cmd is only my way of combining things: first execute wget to download all the files that have changed, then execute wget to get the file dbsender.php. Of course if you retrieve a file ending in .php all of the code in the file will be executed.
The script xyz.cmd is not running on my own computer, it runs on a computer in our teachers' room so the email I get is kind of a reassuring: the script has run on that computer....
BTW, Art have you had a chance to look at PhotoFrame as a module ?
On second thoughts ...
I'm thinking of adapting the script in some way so it takes all of the information it needs out of the Moodle config.php file. It could even be possible to add it as an extra cron job. But then we're back at the beginning. The Moodle installation documents already tell you how to setup a cronjob to make dailybackups of database and data directory....
I started using this script in december 2003 with Moodle version 1.1.1 It's been running without problems ever since, but now of course Moodle has this excellent Automatic Backup facility. It might be more reassuring for your friend to know that Moodle can run scheduled backups for all his courses.