shtools/dbdump.sh
2024-11-20 12:24:17 +08:00

6 lines
169 B
Bash
Executable File

#!/usr/bin/bash
date=$(date +%Y-%m-%d)
mysqldump -utest -ptest123 sage > ~/db/sage-${date}.sql
find ~/db -name "*.sql" -mtime +1 -print|awk '{print("rm -f", $1)}'| sh