1
melsen
WICKED ass cool COMPLETE backup script for your Xoops Installation!!
  • 2006/1/12 16:55

  • melsen

  • Just popping in

  • Posts: 97

  • Since: 2003/6/22


This is a script I use to backup my entire XOOPS installation... Now, depending on how large your installation is, you can do various things here... You can modify it to pack it into smaller files acceptable by your gmail account, and then this script is perfect for all files and SQL DB.

#!/bin/bash -f

# Determine current date
export CURDATE=`date +%Y%m%d`

#Provide the path for your XOOPS directory
TargetDir=/path/to/your/Xoops/files
Server
=yourserveraddress
MysqlUname
=your_mysql_username
MysqlPass
=your_mysql_pass
MysqlDbase
=your_mysql_database
SndEmail
=your@domain.com


# Backup XOOPS database to compressed, dated file in tmp directory
echo backing up MySQL database to file /tmp/${CURDATE}_db-backup.sql.gz
mysqldump 
--opt ---h${Server} -u${MysqlUname} -p${MysqlPass} ${MysqlDbase} | gzip > /tmp/${CURDATE}_db-backup.sql.gz


# Backup WP files to compressed, dated file in tmp directory
cd $TargetDir
echo backing up all files to /tmp/${CURDATE}_files.tar.gz
tar cf 
- . | gzip > /tmp/${CURDATE}_files.tar.gz

# Send emails with the files (GMail anyone?)
cat /tmp/${CURDATE}_db-backup.sql.gz uuencode ${CURDATE}_db-backup.sql.gz mail -${CURDATE}.BackupDatabase ${SndEmail}
echo 
Done sending email with MySQL backup ...
cat /tmp/${CURDATE}_files.tar.gz uuencode ${CURDATE}_files.tar.gz mail -${CURDATE}.BackupFiles ${SndEmail}
echo 
Done sending email with file backup ...


# delete the backup files from the server after you are done with the email
echo Deleting MySQL backup files
rm 
--force /tmp/${CURDATE}_db-backup.sql.gz
echo Deleting file backup
rm 
--force /tmp/${CURDATE}_files.tar.gz
Allan Melsen
[size=x-small]Founder of R.I.A.[/size]

Renegade Insane Asylum

2
Sophie2
Re: WICKED ass cool COMPLETE backup script for your Xoops Installation!!
  • 2006/1/12 18:28

  • Sophie2

  • Just popping in

  • Posts: 81

  • Since: 2005/11/21


anyone can confirm this?

3
melsen
Re: WICKED ass cool COMPLETE backup script for your Xoops Installation!!
  • 2006/1/13 12:57

  • melsen

  • Just popping in

  • Posts: 97

  • Since: 2003/6/22


.. Confirm?

What do you need confirmed? Just look at the batch script - No malicious code.... try it out yourself... works like a charm.

Though, one thing.. if you need to send it to fx. gmail, you need to modify it a bit, and possibly split up the files since gmail only accepts 10mb files.
Allan Melsen
[size=x-small]Founder of R.I.A.[/size]

Renegade Insane Asylum

4
Sophie2
Re: WICKED ass cool COMPLETE backup script for your Xoops Installation!!
  • 2006/1/13 15:56

  • Sophie2

  • Just popping in

  • Posts: 81

  • Since: 2005/11/21


i don't know any php
someone must confirm that there is no malicious code
sory i can't trust anyone

5
JamesSAEP
Re: WICKED ass cool COMPLETE backup script for your Xoops Installation!!
  • 2006/1/13 16:09

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


I've been using this backup utility for over a year now. I have it backup 4 databases and it emails me the backups nightly.

http://restkultur.ch/personal/wolf/scripts/db_backup

Login

Who's Online

373 user(s) are online (265 user(s) are browsing Support Forums)


Members: 0


Guests: 373


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits