点击进入:Linux shell crontab expdp 定时任务逻辑备份 定时删除旧文件 首先建一个备份数据库用批处理文件,内容如下: rem expdp sz set sz_file=SZ_%date:~0,4%%date:~5,2%%date:~8,2%.dmp set sz_logfile=SZ_%date:~0,4%%date:~5,2%%date:~8,2%.log expdp user/pwd schemas=user_schema directory=dump_dir DUM
有的时候我们在使用ES时,由于资源有限或业务需求,我们只想保存最近一段时间的数据,所以有如下脚本可以定时删除数据 delete_es_by_day.sh #!/bin/sh # example: index_name=$ daycolumn=$ savedays=$ format_day=$ if [ ! -n "$savedays" ]; then echo "the args is not right,please input again...." exit f
Windows 定时删除指定路径下N天前的日志文件 Windows 下bat脚本文件的内容为 1. 删除指定路径下5天前的所有文件 @echo off set SrcDir=E:\WORK\Git set DaysAgo=5 forfiles /p %SrcDir% /s /m *.*/d -%DaysAgo% /c "cmd /c del /f /q /a @path" 2.删除指定路径下5天前的所有log文件 @echo off set SrcDir=E:\WORK\Git //指
mysql定时删除当前时间前分钟的数据 2013-01-31 0个评论 作者:上官车月 收藏 我要投稿 mysql定时删除当前时间前分钟的数据 Sql代码 www.2cto.com SET GLOBAL event_scheduler = ON; delimiter $$ drop event if exists e_wom_stat; create event e_wom_stat on schedule EVERY 1 day