#!/bin/bash
bakdir='/data/dbbak'
ps aux | grep xtrabackup | grep -v grep
if [[ $? -eq 0 ]];then
ps aux | grep xtrabackup | grep -v grep | awk '{print $2}' | xargs kill -9
echo "`date +'%Y%m%d%H%M%S'`:kill xtrabackup process" >> ${bakdir}/mysql_bak.err
fi
ps aux | grep mysqldump | grep -v grep
if [[ $? -eq 0 ]];then
ps aux | grep mysqldump | grep -v grep | awk '{print $2}' | xargs kill -9
echo "`date +'%Y%m%d%H%M%S'`:kill mysqldump process" >> ${bakdir}/mysql_bak.err
fi