Window bat expdp 数据库定时任务逻辑备份数据库 定时删除N天前的旧文件
Linux shell crontab expdp 定时任务逻辑备份数据库 定时删除旧文件
forfiles 命令,目录路径最后多了""
rem 每天备份脚本
mysqldump -uroot -p123456 iron_his > D:\Software\0.DB.Backup\his_%date:~0,4%%date:~5,2%%date:~8,2%.sql
rem delete 5 days files
forfiles /p "D:\Software\0.DB.Backup\" /d -5 /c "cmd /c echo deleting @file ... && del /f @path"
rem 每天备份脚本
mysqldump -uroot -p123456 iron_his > D:\Software\0.DB.Backup\his_%date:~0,4%%date:~5,2%%date:~8,2%.sql
rem delete 5 days files
forfiles /p "D:\Software\0.DB.Backup" /d -5 /c "cmd /c echo deleting @file ... && del /f @path"