linux上定時備份mysql資料庫,linuxmysql資料庫

來源:互聯網
上載者:User

linux上定時備份mysql資料庫,linuxmysql資料庫
定時備份資料庫
/usr/sbin/backupmysql
timestamp=`date +"%Y-%m-%d-%H-%M-%S"`
mysqldump -uroot -p'123456 databasename>/db$timestamp.sql


chmod +x backupmysql
安裝crontab:
[root@CentOS ~]# yum install vixie-cron
[root@CentOS ~]# yum install crontabs


crontab -e 新增定時任務
0 3 * * * root /usr/sbin/backupmysql
crontab -l 顯示定時任務

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.