Membership Membership:
Latest New User Latest: vpros
Past 24 Hours Past 24 Hours: 0
Prev. 24 Hours Prev. 24 Hours: 0
User Count Overall: 137

People Online People Online:
Visitors Visitors: 84
Members Members: 0
Total Total: 84

NakedMCSE Computer Tech Support Forums

So you have passed all of the exams and you are now out in the real world of windows servers, linux servers and freebsd servers faced with a tech support problem you have never seen before...

Find free online tech support in the forums below, respecting that advice is free, but work beyond advice is not...

The General forum is provided for off topic discussion.

You need a user account to post - please Register or Login.

Online Tech Support Forums
 
  Forum  Open Source Tec...  MySQL Server  MySQL Linux | Unix Backup Script
Previous Previous
 
Next Next
New Post 9/21/2009 3:09 PM
Informative
  Walker
119 posts
www.lairdscomputer.com
10th Level Poster


MySQL Linux | Unix Backup Script 
Modified By Walker  on 9/24/2009 4:25:46 PM)

 This is a script I use on my linux/unix boxes to backup MySQL.  It creates a backup for every day of the month and stores the backups on the first of each month:

#!/bin/sh
# MySQL Backup Script
# 1st - FULL ARCHIVE
# 2nd - 31st FULL OVERWRITE
#
DATE_DAY=`date +%d`
DATE_MONTH=`date +%b`
GZIP=/usr/bin/gzip
MYSQLDUMP=/usr/bin/mysqldump

if [ "$DATE_DAY" == "01" ]
then
  $MYSQLDUMP -u root -pyourrootpassword --all-databases > /backup/archive/mysql-$DATE_MONTH.sql
  $GZIP -f /backup/archive/mysql-$DATE_MONTH.sql
else
  $MYSQLDUMP -u root -pyourrootpassword --all-databases > /backup/mysql-$DATE_DAY.sql
  $GZIP -f /backup/mysql-$DATE_DAY.sql
fi

Adjust the paths, switches and variable names as necessary.

Walker
Lairds Computer Services

 
Previous Previous
 
Next Next
  Forum  Open Source Tec...  MySQL Server  MySQL Linux | Unix Backup Script
Send me One Million FREE Guaranteed Visitors