Last active
April 15, 2022 12:02
-
-
Save peytonyip/77365966150dac573963c04dc731683c to your computer and use it in GitHub Desktop.
[一些 shell 脚本] #shell
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/bash | |
| datetime=$(date +%Y%m%d%H%M%S) | |
| dbs=("chatbot" "chatbot_kg" "chatbot_v2" "chatbot_walle" "nlp_asr_tts_ws" "quality_check" "sound" "walle_deploy") | |
| #dbs=("walle_deploy") | |
| for ((i=0;i<${#dbs[@]};i++)) | |
| do | |
| cd /home/work/workplace/backup | |
| db=${dbs[$i]} | |
| /home/work/workplace/mariadb-10.4.8/bin/mysqldump -ubackup_ro -pbackup_ro -h172.18.36.235 --lock-tables=false --quick --databases "${db}" > "${db}-${datetime}.sql" | |
| done | |
| find /home/work/workplace/backup -mtime +7 -name "*.*" -exec rm -rf {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment