PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 PHPBB: Automated backups of forums using admin pages 
Description: For those wishing to do dumps of the database as provided via the forums admin pages but in an automated fashion a borne script is provided
Author: ra120271
Date: Tue Apr 29, 2003 2:00 pm
Type: HowTo
Keywords: automated backup
Category: Administrating
For those wishing to do dumps of the database as provided via the forums admin pages but in an automated fashion a borne shell script:

Updated May 1th 2003:
Code:
#!/bin/sh

#Change these Vars for your environment
STORE=~root/phpbb-backups
ADMINID="admin"
ADMINPASSWD="yoursecret"
FORUMNAME="forum"
FORUMBASEURL="http://yourdomain.com/subdir"

umask 077
# cd to where the logs will be stored
cd $STORE

# Rotate the previous downloads
mv -f $FORUMNAME.backup.sql.6 $FORUMNAME.backup.sql.7 2>/dev/null
mv -f $FORUMNAME.backup.sql.5 $FORUMNAME.backup.sql.6 2>/dev/null
mv -f $FORUMNAME.backup.sql.4 $FORUMNAME.backup.sql.5 2>/dev/null
mv -f $FORUMNAME.backup.sql.3 $FORUMNAME.backup.sql.4 2>/dev/null
mv -f $FORUMNAME.backup.sql.2 $FORUMNAME.backup.sql.3 2>/dev/null
mv -f $FORUMNAME.backup.sql.1 $FORUMNAME.backup.sql.2 2>/dev/null
mv -f $FORUMNAME.backup.sql $FORUMNAME.backup.sql.1 2>/dev/null

# Login to the board
curl -d username=$ADMINID -d password=$ADMINPASSWD -d login=1 -D /tmp/header.out.$$ $FORUMBASEURL/login.php

#Get the sid
sid=`grep '?sid' /tmp/header.out.$$ | cut -f2 -d\?`

# Download the db
curl -s -S -b /tmp/header.out.$$ -d backupstart=1 -d backup_type=full -d gzipcompress=0 -d perform=backup -d startdownload=1 $FORUMBASEURL/admin/admin_db_utilities.php\?$sid > $FORUMNAME.backup.sql

# Clean up
rm -f /tmp/header.out.$$


For updated information concerning this code look here:
PHPBB: Automated backups of forums using admin pages

Hope this helps some of you.

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.