From: Reini U. <ru...@x-...> - 2001-10-21 16:07:49
|
Steve Wainstead schrieb: > On Wed, 17 Oct 2001, Adam Shand wrote: > > ps. i assume everyone knows but moinmoin and twiki's sourceforge page= s > > were totally wiped by someone the other day, and since the pages were > > read/write sf does't want to restore them. it might pay to make sure= that > > someone has a backup of the phpwiki page database in case this is wik= i > > hatred :-) >=20 > Wow, that's awful! I've made a zip dump of the current site. Thanks for > the heads-up. I make dialy backup's. Not only zipdump's, also incremental RCS versions. Did I never post this shell script? This is for a dialy zipdump of my german murwiki: #!/bin/sh # dump wikidb from murwiki cd //v/mur/wiki baseurl=3D"http://tv.mur.at/murwiki/" zip=3D`date +"wiki-%Y%m%d.zip"` log=3Dwiki.log # login=3D"http://xarch.tu-graz.ac.at/autocad/wiki/PhpWikiAdministration?ac= tion=3Dlogin" dump=3D$baseurl"PhpWikiAdministration?action=3Dzip" changes=3D$baseurl"Letzte=C4nderung" # xlog=3Dacadwiki-1.3.4pre/log/xarch_access.log credentials=3D' --http-user=3Dadmin --http-passwd=3Dxxx' echo "dumping $changes..." wget -nv -OLetzte=C4nderung-`date +"%Y%m%d"` $changes wget -nv $credentials -a$log -O$zip $dump # wget -nv $credentials -a$log http://xarch.tu-graz.ac.at/home/rurban/$xl= og echo "$baseurl successfully dumped to $zip." this is a better one, into RCS: #!/bin/sh # shell script to save a [remote] phpwiki v1.3x into RCS # # cron sample for daily backup # 0 1 * * * cd ~/backup/wiki1; ~/phpwiki/wbackup --http-user=3Drurban --http-passwd=3Dpass http://xarch.tu-graz.ac.at/acadwiki/ # 10 1 * * * cd ~/backup/wiki2; ~/phpwiki/wbackup http://tv.mur.at/murw= iki/ # default cfg, if no arguments given wikiurl=3D$@ if [ -z "$wikiurl" ]; then wikiurl=3D"http://xarch.tu-graz.ac.at/acadwiki/" fi # create rcs in the actdir=20 # path of backup, RCS will be created in a subdir reldir=3D`dirname $0` homedir=3D`cd $reldir; pwd` tmpdir=3D/tmp/phpwiki zip=3D/tmp/`/bin/date +"phpwiki-%Y%m%d.zip"` # log=3D/var/log/phpwiki.log log=3D$homedir/phpwiki.log # changes=3D$wikiurl"RecentChanges" # echo "dumping $changes..." # wget -ORecentChanges-`date +"%Y%m%d"` $changes /usr/bin/wget -nv -a$log -O$zip $wikiurl"PhpWikiAdministration?action=3Dz= ip" # echo "$wikiurl successfully dumped to $zip." /bin/rm -rf $tmpdir /usr/bin/unzip $zip -d $tmpdir/ pushd $tmpdir files=3D$(ls --color=3Dnone *) popd for f in $files; do=20 # overwrite old if [ ! -f $f,v ]; then=20 /bin/cp -f $tmpdir/$f . /usr/bin/rcs -i -q -U -t-"phpwiki backup" $f;=20 /usr/bin/sed -e"1d" $tmpdir/$f >$f fi # drop first line to ignore equal files=20 # this holds only "From <backup date>" /usr/bin/sed -e"1d" $tmpdir/$f >$f /usr/bin/ci -q -m'#' $f /bin/rm -f $tmpdir/$f done /bin/rm -f $zip /bin/rmdir $tmpdir This is one of my sample cronjob scripts: #!/bin/sh cd /home/rurban/proj/wiki/acadwiki ../wbackup --http-user=3Dadmin --http-passwd=3Dxxx http://xarch.tu-graz.ac.at/acadwiki/ |