Difference between revisions of "Tools for backing up server files"

From MoodleDocs
(Split this out of site backup page)
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
There are many ways to back up server files that contain Moodle code and moodledata. [[Site Backup for Low-tech Users]] also has information on this subject.
  
 
==Rsync in linux==
 
==Rsync in linux==
Line 23: Line 24:
 
  rmdir /tmp/remote-folder
 
  rmdir /tmp/remote-folder
  
==wget==
+
==Wget==
 
[http://en.wikipedia.org/wiki/Wget wget] can be used to backup the entire database. For example use something like these commands(tested on cPanel web interface):
 
[http://en.wikipedia.org/wiki/Wget wget] can be used to backup the entire database. For example use something like these commands(tested on cPanel web interface):
  

Latest revision as of 17:22, 20 November 2010

There are many ways to back up server files that contain Moodle code and moodledata. Site Backup for Low-tech Users also has information on this subject.

Rsync in linux

For the files, you can use rsync regularly to copy only the changed files to another host:

rsync -auvtz --delete -e ssh mysshusername@example.com:/my/server/directory /my/backup/directory/

If you want to run the cronscript at the machine you are running Moodle at you have to use following rsync syntax

rsync -auvtz --delete -e ssh /path/to/local/folder/ remoteuser@remoteserver:/path/to/remote/folder/

If you do not want the root mailbox be spammed by statusmails of the rsync use:

 rsync -autzq --delete -e ssh /path/to/local/folder/ remoteuser@remoteserver:/path/to/remote/folder/

FTP

If your Moodle hosting provider does not allow ssh (or just do not provide it) and you have simple [File Transfer Protocol FTP] (a File Transfer Protocol) access with a username and a password you can also use:

mkdir /tmp/remote-folder
curlftpfs ftp://username:password@ftp.your-site.com /tmp/remote-folder
rsync -auvtz --delete /tmp/remote-folder /my/local/backup/folder/
umount /tmp/remote-folder
rmdir /tmp/remote-folder

Wget

wget can be used to backup the entire database. For example use something like these commands(tested on cPanel web interface):

wget --http-user=username --http-password=password http://your-site.com:2082/getsqlbackup/moodle.sql.gz

and the entire backup of the Moodle code tree:

wget --http-user=username --http-password=password http://your-site.com:2082/getbackup/backup-your-site.com-`date +"%-m-%d-%Y"`.tar.gz

Some customization might be needed for other web interface like (webmin?)

See also