Kapalı

Need Script Help IMMEDIATE

I am trying to modify a script which does backups to do my lvm backups. I am running into some trouble with it and was hoping someone could help me write it. This is what I have at the moment. I would like to add an option to the script to back up as lvm snapshot of the data directory instead of mysqldump. I want this to be a command line option

#################################################################################

# #

# Run Full Backups, All Databases #

# #

#################################################################################

TARERRFILE=${BKUP_DIR}/${BKUPDT}_${SERVER}_${INSTANCE}_${TYPE}[url removed, login to view]

if [ "${TYPE}" = "full" ]

then

echo ${TYPE}

echo "show databases;" > /tmp/get_databases_$$.sql

#################################################################################

# #

# Loop through all databases and run mysqldump with database consistent backups #

# if using innodb database engine (--single-transaction). Use 'quick' mode for #

# backing up row at a time vs storing rows in mem for large tables. #

# use -R to include any stored procedures/functions #

# #

#################################################################################

tar -chSvf ${TARERRFILE} /tmp/get_databases_$$.sql

for DATABASE in `mysql -u ${BACKUP_USER} -p${BACKUP_PASS} --silent --skip-column-names < /tmp/get_databases_$$.sql | grep -iv information_schema | grep -iv ^#`

do

ERRFILE=${BKUP_DIR}/${BKUPDT}_${SERVER}_${INSTANCE}_${DATABASE}_${TYPE}[url removed, login to view]

BKUPFILE=${BKUP_DIR}/${BKUPDT}_${SERVER}_${INSTANCE}_${DATABASE}_${TYPE}[url removed, login to view]

echo "Backing up $DATABASE at ${BKUPDT}" 2>&1 > ${ERRFILE}

mysqldump -v -u ${BACKUP_USER} -p${BACKUP_PASS} --single-transaction -R --quick ${DATABASE} 2>> ${ERRFILE} | gzip -c > ${BKUPFILE}

COMPDT=`date '+%Y-%m-%d-%H%M'`

echo "Completed at ${COMPDT}" 2>&1 >> ${ERRFILE}

#################################################################################

# #

# Check for any errors with the backups #

# #

#################################################################################

BACKUP_ERRORS=`grep -i error ${ERRFILE} | grep -v delayed`

if [ "$BACKUP_ERRORS" ]

then

echo "Errors Found"

BACKUP_ERR_CNT=1

fi

tar -rvhSf ${TARERRFILE} ${ERRFILE}

rm -f ${ERRFILE}

done

Beceriler: MySQL, Perl, Kabuk Betiği

Daha fazlasını görün: need sql help, sql databases, loop back, 270 transaction, sql r, r sql, p sql, stored procedures, snapshot, skip , shell script, rm, p v, need quick mysql script, immediate, gzip, gz, silent server, script gzip, shell script perl, 2010 write sql database, command help, mysql loop sql, help using, help modify

İşveren Hakkında:
( 0 değerlendirme ) woodinville, United States

Proje NO: #724895

13 freelancer bu iş için ortalamada 87$ teklif veriyor

SigmaVisual

We can help in your project, please check PMB and our ratings/reviews to get idea of our experience.

in 4 gün içinde100$ USD
(76 Değerlendirme)
6.9
srinichal

I can deliver the script for the same

in 4 gün içinde40$ USD
(45 Değerlendirme)
6.3
gangabass

I can do this job for you. See PM for details.

1 gün içinde 30$ USD
(186 Değerlendirme)
6.1
osmanbsd

Can make it working.

in 0 gün içinde50$ USD
(24 Değerlendirme)
5.5
gasparch

Please see pm :)

in 2 gün içinde79$ USD
(27 Değerlendirme)
5.3
YashpalSingh123

php/mysql expertise, ready to start

in 2 gün içinde200$ USD
(3 Değerlendirme)
4.1
trezorg

Hi. I can rewrite the script.

1 gün içinde 30$ USD
(12 Değerlendirme)
3.9
rajelensoft

Please see private message..........

in 3 gün içinde100$ USD
(4 Değerlendirme)
3.0
gajendra123

This is not complete script. There should be additional files. I have team of experienced and certified sys admins. We work as team. We can help you.

in 10 gün içinde250$ USD
(1 Değerlendirme)
1.2
ordex

Hello, it will be easy to add an option to that script. But you should explain better what you mean with "as lvm snapshot".

in 5 gün içinde90$ USD
(0 Değerlendirme)
0.0
libvenus

I can do this .. but i have a few questions that i must clarify. Please check PM.

in 2 gün içinde30$ USD
(0 Değerlendirme)
0.0
daelious

I have more than 10 years experience with Linux systems. I also on regular occasion write Perl/Python backup scrips and use LVM on all my servers. Thank you for your consideration. Keith

in 5 gün içinde100$ USD
(0 Değerlendirme)
0.0
ireenki

Hi it's easy ...

in 0 gün içinde30$ USD
(0 Değerlendirme)
0.0