#!/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