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
/tmp目录文件重启后自动删除现在知道有ubuntu和solaris系统source:http://blog.chinaunix.net/uid-26212859-id-3567875.html经常会把临时性的log或抓包等文件放在/tmp目录下,重启后发现文件都丢失了.查下资料发现,可以通过设置解决这个问题.在/etc/default/目录下有个rcS文件,文件内容如下:## /etc/default/rcS## Default settings for the scripts in /etc
#coding:utf-8import MySQLdb #方法1直接在Navicat中添加计划任务#DELETE FROM message2 where SEND_TIME < UNIX_TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL 90 day)) #方法2conn= MySQLdb.connect( host='xxx.xxx.xxx.xxx', port = 3306, user='root', passwd='xxxx', db ='xxx', ) cur
#获取所有文件def file(): for cur_dir, dirs, files in os.walk(r'/学习/接口自动化/BestTest/作业/logs'): # cur_dir(当前路径),dirs(目录),files(文件)中所有的 for file in files: abs_path = os.path.join(cur_dir, file) # 获取绝对路径 if int(timestamp_to_str(abs_path.split("_")[1].split
把以下命令保存为ps1脚本,添加到Windows计划任务中设定每天固定时间执行即可: #delete logs in specify website, just save logs in eight days~ $TimeOutDays=8 $filePath="C:\public\" $allFiles=get-childitem -path $filePath foreach ($files in $allFiles) { $daypan=((get-date)-$files.la