Untitled

By Beige Pheasant, 11 Years ago, written in Plain Text, viewed 970 times.
URL http://pb.stoleyour.com/view/2d06f44c Embed
Download Paste or View RawExpand paste to full width of browser
  1. [root@WEBSERVER02 ~]# more /etc/cron.hourly/fhc_backup.sh
  2. #!/bin/sh
  3. #stop the mysql slave thread but let the i/o thread run so it catches up faster to the master
  4. /usr/bin/mysql -e 'stop slave sql_thread;'
  5. #dump the database and compress it while appending the full date
  6. /usr/bin/mysqldump fhc_vbulletin | gzip -9 > /forumbkp/fhc_vbulletin-$(date +%F--%T).sql.gz
  7. #start the sql thread again
  8. /usr/bin/mysql -e 'start slave sql_thread;'
  9. #remove backups older than 48 hours
  10. cd /forumbkp
  11. ls -t | sed -e '1,48d' | xargs -d '\n' rm

Reply to "Untitled"

Here you can reply to the paste above