随笔分类 - shell
摘要:最近项目需要定时备份mysql数据库的数据,根据需求写了一份定时备份mysql数据库的脚本。在这儿记一下以后要用了可以直接拿来用 -h mysql的地址 默认为localhost -P 端口号 默认为3306 -u 用户 默认为root -p 密码 默认为123456 -f 备份存放地址 默认为 /
阅读全文
摘要:#!/bin/bash arr=(12 36 '你好') length=${#arr} echo "长度为:$length" # for 遍历 for item in ${arr[*]} do echo $item done i=0 # until遍历 echo until begin until
阅读全文