shtools/dbdump.sh

6 lines
169 B
Bash
Raw Permalink Normal View History

2024-11-20 12:24:17 +08:00
#!/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