Saminnet-Search Article Wiki Forum Piwigo SNS Cloud vtiger Sugar
MySQL Backup

MySQL Backup

zroot:/backup # cat /backup/backuprra.sh
-----------------------------------------------------------
#/bin/bash
cd /backup

# Remove old backups
find /backup/datarra/* -mtime +5 -exec rm -f {} \; > /dev/null 2>&1

# Create the filename for the backup
eval `date "+day=%d; month=%m; year=%Y"`
INSTFIL="cacti-rra-backup-$year-$month-$day.tar.gz"

#Backup rra
cd /opt/cacti/cacti-0.8.6j/rra
tar -Pcpzf /backup/datarra/$INSTFIL *
-----------------------------------------------------------


zroot:/backup # cat /backup/backup-monthly-report-table.sh
-----------------------------------------------------------
#/bin/bash
cd /backup

# Remove old backups
find /backup/datamonthlytable/* -mtime +1 -exec rm -f {} \; > /dev/null 2>&1

# Create the filename for the backup
eval `date "+day=%d; month=%m; year=%Y; hour=%H"`
INSTFIL="ias-monthly-report-backup-$year-$month-$day-$hour.tar.gz"

#Backup Table monthly report
mysqldump -u root -prootdb --database itf --table file0_get > bkpdb/file0_get_`date +%Y%m%d-%H%M%S`.sql
mysqldump -u root -prootdb --database itf --table file1_ond > bkpdb/file1_ond_`date +%Y%m%d-%H%M%S`.sql

# Gzip the whole folder
cd /backup/bkpdb
tar -Pcpzf /backup/datamonthlytable/$INSTFIL *
cd /backup/bkpdb
rm -fv *
-----------------------------------------------------------


zroot:/backup # cat /backup/bkpkeep.sh
-----------------------------------------------------------
#/bin/bash
cd /backup
find /backup/rra/* -mtime +5 -exec rm -f {} \; > /dev/null 2>&1
find /backup/mysql/* -mtime +5 -exec rm -f {} \; > /dev/null 2>&1
-----------------------------------------------------------

Comments   

 
0 #1 Guest 2016-12-26 14:06
Hi, i think that i saw you visited my web site so i came to return the favor?.I am attempting to
find things to improve my web site!I guess its ok to use a few of your
ideas!!

Feel free to surf to my homepage; Friv 6
Quote
 

Category Database

TweetTweet Share on LinkedInShare on LinkedIn Share on Google+Google+ Submit to RedditReddit Publish on WordPress WordPress Send emailSend email