当前位置:网站首页>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 .
边栏推荐
- 【Laravel系列8】走出 Laravel 的世界
- Why is the test post a giant pit? The 8-year-old tester told you not to be fooled
- Webapck system foundation
- ROS URDF model is parsed into KDL tree
- 043. (2.12) what will happen if you become enlightened?
- 1019 数字黑洞
- Libuv library overview and comparison of libevent, libev and libuv (Reprint)
- SQL 数据记录如何上下行合并
- [C language] address of stack memory associated with local variable 'num' returned
- 1018 锤子剪刀布
猜你喜欢

MySQL subquery

Remote connection of raspberry pie in VNC Viewer Mode

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

SqlServer如何查询除去整列字段为null的结果

Establishment of small and medium-sized enterprise network
![[C language] explain the thread exit function pthread_ exit](/img/fb/96db1c712370dbb216a06440ecdc5e.png)
[C language] explain the thread exit function pthread_ exit

IDEA修改jvm内存

LabVIEW显示Unicode字符

Runtimeerror in yolox: dataloader worker (PID (s) 17724, 1364, 18928) exited unexpectedly

Build a simple website by yourself
随机推荐
LabVIEW显示Unicode字符
How to merge upstream and downstream SQL data records
If you choose the right school, you can enter Huawei as a junior college. I wish I had known
What is the dry goods microservice architecture? What are the advantages and disadvantages?
Multi machine LAN office artifact rustdesk use push!!!
IDEA修改jvm内存
Anaconda自带的Spyder编辑器启动报错问题
1015 德才论
树莓派用VNC Viewer方式远程连接
CDC2.2.1还不支持postgresql14.1么?基于pgbouncer连接方式下,以5433
MySQL can only add small tables when adding tables dynamically. If you increase the size of tables, you won't read data when running tasks. Is there any solution
【新功能】Ambire 钱包集成了 Metis 网络
Go Foundation (I)
从零到一,教你搭建「以文搜图」搜索服务(一)
JSX的基本使用
云主机mysql在本地电脑连接不上
If I hadn't talked to Ali P7, I wouldn't know I was a mallet
[new function] ambire wallet integrates Metis network
热更新流程
Practical part: solving the function conflict between swagger and user-defined parameter parser