24 lines
859 B
Plaintext
24 lines
859 B
Plaintext
|
#!/bin/bash
|
||
|
SNAPDATE=`date +%Y%m%d`
|
||
|
TMPDIR=`mktemp -d`
|
||
|
MYSQL_USER=
|
||
|
MYSQL_PASSWORD=
|
||
|
echo "Creating www sites backup archives..."
|
||
|
tar cjf $TMPDIR/openmamba-www-backup-$SNAPDATE.tar.bz2 /var/www/www.openmamba.org/
|
||
|
tar cjf $TMPDIR/openmamba-wiki-backup-$SNAPDATE.tar.bz2 /var/www/wiki.openmamba.org/
|
||
|
tar cjf $TMPDIR/openmamba-forum-backup-$SNAPDATE.tar.bz2 /var/www/forum.openmamba.org/
|
||
|
tar cjf $TMPDIR/openmamba-bugs-backup-$SNAPDATE.tar.bz2 /var/www/bugs.openmamba.org/
|
||
|
|
||
|
echo "Creating openmamba database dump..."
|
||
|
mysqldump -u $MYSQL_USER --password="$MYSQL_PASSWORD" openmamba > $TMPDIR/openmamba-mysql.dump
|
||
|
|
||
|
echo "Creating /etc backup..."
|
||
|
tar cjf $TMPDIR/openmamba-etc-backup-$SNAPDATE.tar.bz2 /etc
|
||
|
|
||
|
echo "Creating final global archive..."
|
||
|
cd $TMPDIR
|
||
|
tar cjvf /root/openmamba-server-backup-$SNAPDATE.tar.bz2 * || exit 1
|
||
|
cd ..
|
||
|
|
||
|
[ "$TMPDIR" ] && rm -rf $TMPDIR
|