http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki
is a manual for making a scheduled backup.
It states the importance of making such a backup.
In fact, it states that every mediawiki should make such a backup.
I can't agree more.
Without any activity on my part on the wiki, and I suppose no activity from users (the wiki is not being promoted yet) the database got corrupt.
I haven't got a clue why this happened, but it learns me a wiki is rather vulnerable in that way.
But, and now my point comes, the manual is not a manual at all, or only a manual for expert users.
I would like to make it a real manual, but can't do that alone because I'm nor an expert myself, au contraire. But I can state how a good manual can look like (and help myself realizing my own scheduled manual; Anyway, I could not get it working yet).
This is the cron command:
/usr/bin/nice -n 19 /usr/bin/mysqldump -u $USER --password=$PASSWORD $DATABASE -c | /usr/bin/nice -n 19 /bin/gzip -9 > ~/backup/wiki-$DATABASE-$(date '+%Y%m%d').sql.gz
a. First about the program-needs of the cronjob.
I myself have DirectAdmin, a very common used program (a program by the way you never can choose yourself). The manual should state in which way the command needs to be crosschecked with the program (which arguments are program-depended, which not; likewise: which arguments are user-dependent).
I have doubts about:
* /usr/bin/nice (nice?)
* 19 and 9 (is this really correct?)
* -u $USER
is this the user in the reseller account or the username of the database?
in DirectAdmin only the resellers account can make a cronjob, and therefore the user in question should be stated, otherwise it makes a backup of the resellers-database
should USER be replaced by the username of the account, or the domainname (or the $ as well?)
* ~/backup/
should you make the directory yourself and where should it be placed (not sure about the ~)
where should I find the backupfile if it's working properly (I think in the resellers account..)
* can the command line always find the database?
or should there be a check of some sort?
b. user dependent
* replace PASSWORD with the database password (or the $ as well?)
* replace DATABASE with the username of the database (true?)
* replace the second DATABASE ? or is it just the name of the file
Rein wrote:
This is the cron command:
/usr/bin/nice -n 19 /usr/bin/mysqldump -u $USER --password=$PASSWORD $DATABASE -c | /usr/bin/nice -n 19 /bin/gzip -9 > ~/backup/wiki-$DATABASE-$(date '+%Y%m%d').sql.gz
a. First about the program-needs of the cronjob.
I myself have DirectAdmin, a very common used program (a program by the way you never can choose yourself). The manual should state in which way the command needs to be crosschecked with the program (which arguments are program-depended, which not; likewise: which arguments are user-dependent).
I have doubts about:
- /usr/bin/nice (nice?)
It's nice program. I see here a /bin/nice but not a /usr/bin/nice
- 19 and 9 (is this really correct?)
Yes. nice -n 19 lowers the priority to 19 (lowest). gzip -9 uses best compression-
- -u $USER
is this the user in the reseller account or the username of the database?
The username for the db
in DirectAdmin only the resellers account can make a cronjob, and therefore the user in question should be stated, otherwise it makes a backup of the resellers-database
should USER be replaced by the username of the account, or the domainname (or the $ as well?)
The username for the db, also replace the $
- ~/backup/
should you make the directory yourself and where should it be placed (not sure about the ~)
The ~ expands to your home. ~/backup/ is a folder in your home (yes, make it yourself). You can provide another location if you want.
where should I find the backupfile if it's working properly (I think in the resellers account..)
In the backup folder.
- can the command line always find the database?
or should there be a check of some sort?
Well, for example, you could have permission errors. But if it works the first time, it will continue working. Plus, when you have a number of backups an error would produce a file much smaller.
b. user dependent
replace PASSWORD with the database password (or the $ as well?)
replace DATABASE with the username of the database (true?)
replace the second DATABASE ? or is it just the name of the file
Replace all $DATABASE with the database name Replace $USER with the db user. Replace $PASSWORD with the db password.
mediawiki-l@lists.wikimedia.org