当前位置:网站首页>How to write MySQL scheduled backup script in Linux
How to write MySQL scheduled backup script in Linux
2022-06-29 04:23:00 【Yisu cloud】
Linux in mysql How to write a script for scheduled backup
This article “Linux in mysql How to write a script for scheduled backup ” Most people don't quite understand the knowledge points of the article , So I made up the following summary for you , Detailed content , The steps are clear , It has certain reference value , I hope you can gain something after reading this article , Let's take a look at this article “Linux in mysql How to write a script for scheduled backup ” Article bar .

1. Create a backup script
Backup scripts :
#!/bin/bashdate_str=$(date +%Y%m%d-%T)cd /bf/mysql_back mysqldump -h localhost -u root --password=PASSWORD -R -E -e \databaseName \ | gzip > /bf/mysql_back/database_$date_str.sql.gz
2. Perform scheduled tasks
utilize crontab Execute the above script regularly
crontab -e
Backup every Monday morning
05 02 * * 1 /home/mysqls_backup/mysqlbackup.sh
see crontab list
crontab -l
Immediate effect
/etc/init.d/cron restart
That's about “Linux in mysql How to write a script for scheduled backup ” The content of this article , I believe we all have a certain understanding , I hope the content shared by Xiaobian will be helpful to you , If you want to know more about it , Please pay attention to the Yisu cloud industry information channel .
边栏推荐
- Implementation of b+ tree index based on xlsx
- LabVIEW显示Unicode字符
- Webassembly learning - dynamic linking
- ROS URDF model is parsed into KDL tree
- Implementation of thread pool based on variable parameter template
- 要不是和阿里P7聊过,我也不知道自己是个棒槌
- The great gods take connections from the MySQL connection pool in the open of the rich function. The initialization of the connection pool is 20. If the parallelism of the rich function is 1
- Nuxt - set SEO related tags, page titles, icons, etc. separately for each page (page configuration head)
- Analysis on the types of source code anti leakage technology
- The five levels of making money, which level are you on?
猜你喜欢

Wi-Fi 7 来啦,它到底有多强?

C language -- branch structure

JDBC learning

Baidu AI Cloud service grid product CSM release 𞓜 hot public beta

PostgreSQL has a cross database references are not implemented bug

How sqlserver queries and removes results with null fields in the whole column

1018 锤子剪刀布

女程序员晒出5月的工资条:工资是高,但是真累,网友评论炸锅了
![[performance test] introduction and installation of JMeter](/img/8c/cc5dd3e7db02e084937c917cc71e5f.jpg)
[performance test] introduction and installation of JMeter

科班出身,结果外包都不要
随机推荐
Is the increased life insurance off the shelf? What additional life insurance products are available now?
Technology: how to design zkvm circuit
Why is the test post a giant pit? The 8-year-old tester told you not to be fooled
快速开发项目-VScode插件
Nuxt - 每个页面单独设置 SEO 相关标签及网页标题、图标等(页面配置 head)
JDBC learning
【Laravel系列8】走出 Laravel 的世界
043. (2.12) what will happen if you become enlightened?
Apifox : 不仅是Api调试工具,更是开发团队的协作神器
New listing of operation light 3.0 -- a sincere work of self subversion across the times
使用AssetStudio/UnityStudio UABE等
Five thousand years of China
How sqlserver queries and removes results with null fields in the whole column
【HackTheBox】dancing(SMB)
Go Foundation (I)
访问数据库时出现错误
如何创建 robots.txt 文件?
NotImplementedError: Could not run torchvision::nms
JSX的基本使用
Lua protobuff Emmy Lua wheel