这个可通过shell脚本实现。也可通过在DolphinDB中调用shell函数实现。下面的例子代码创建了一个定时作业,实现了每天凌晨删除1天前的定时作业运行日志和返回值。
def rmBatchJobLog(){ path=getHomeDir()+"/batchJobs" filenames=exec filename from files(path) where filename like "%.obj" or filename like "%.msg" and lastModified > datetimeAdd(now(),-1,`d) for(f in filenames){ shell("rm -f "+path+"/"+f); } } scheduleJob(`clearJobLog, "remove log files of batch jobs", rmBatchJobLog, 00:00m, today(), 2050.12.31, 'D');