Anarchopedia:En:MySQL dump

From Anarchopedia
Revision as of 06:31, 11 December 2004 by Millosh (Talk | contribs)

Jump to: navigation, search

Database dumps are produced by script:

 #!/usr/bin/perl -w
 use POSIX qw(strftime);
 $date = strftime "%Y%m%d%H%M", gmtime;
 print "mysqldump --opt -uusername -ppassword anarchopedia cur old > anarchopedia-".$date.".sql\n";
 print "bzip2 anarchopedia-".$date.".sql\n";
 print "mv anarchopedia-".$date.".sql.bz2 /srv/www/virtual/org.anarchopedia/htdocs/db/\n";
 print "chmod a+r /srv/www/virtual/org.anarchopedia/htdocs/db/anarchopedia-".$date.".sql.bz2\n";


Crontab job:

 0  1    * * *   root    /srv/system/bin/ap-mysqldump.pl | sh

(MySQL dumps are generating every day at 01:00 CDT.)