Created
December 20, 2022 18:52
-
-
Save Padilo300/deed8fed528f3c11fb0fc180d5da98db to your computer and use it in GitHub Desktop.
mysql data base backup shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
find /root/data_base_bk/dumps -name '*.*' -mmin +600 -delete > /dev/null #remove files after 10 hour | |
d=$(date +%Y-%m-%d-%H:%M:%S) #make current date | |
mysqldump -u mysql_user_name -h 127.0.0.1 --password='mysqk_password' -P 3306 --no-autocommit --opt data_base_name > "/root/data_base_bk/dumps/data_base_name$d.sql" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment