Talk:Automated course backup: Difference between revisions
From MoodleDocs
Chris Fryer (talk | contribs) No edit summary |
Helen Foster (talk | contribs) m (Talk:Backup (administrator) moved to Talk:Backup settings) |
(No difference)
|
Revision as of 19:36, 28 June 2007
I wonder if administrators should be recommended to use mysqlhotcopy rather than mysqldump
. Although mysqldump
outputs a handy SQL file, it does not lock tables before being called, so there is the potential for data inconsistency on large/busy sites. mysqlhotcopy
locks tables before making copies of the table files themselves. These can be tarred & gzipped for copy to another disk/server:
#!/bin/sh # # clear moodle backup directory rm -R /var/backups/databases/moodle/* # # hotcopy moodle tables mysqlhotcopy --addtodest -u <username> -p <password> moodle /var/backups/databases # # tar & gzip them tar -czf <path_to_homedir>/moodle-db-`date +%Y%m%d`.tar.gz /var/backups/databases/moodle