[闲聊] 20170102修改事项

楼主: laechan (挥泪斩马云)   2018-01-02 09:34:08
今天有改什么的话会贴在这篇,预计会弄 crontab。
mixed crontab_data;
crontab_data=({});
now_line=0;
int cmd_crontab(string str,object me)
{
string s1,s2,s3,s4,s5,s6,s7;
int t1,t2,min,hour,day,mon,week;
mixed tmps=({});
if(!str || str=="")
return notify_fail(@LONG
工作排程(crontab)指令说明:
==============================================
crontab -l 观看目前排程
crontab -e 编辑排程,可做排程的增删改
每一排程都是一行,需按照以下两种格式
分 时 日 月 周 预定执行内容
分 时 日 月 周 预定执行工作 < 排程脚本档
例如
0 * * * * shout 整点报时!
0 * * * * blarket < new_year_blarket.txt
==============================================
LONG
);
if(str=="-l")
return notify_fail(implode(crontab_data,"\n")+"\n"));
if(str=="-e")
{
write(": ");
input_to("crontab_xxx",0,str);
return 1;
}
return notify_fail("没有 crontab "+str+" 这个语法喔.\n");
}
int crontab_xxx(string str)
{
int n;
if(!str || str=="")
{
if(identify(crontab_data)=="({ })")
{
write(": ");
input_to("crontab_xxx",0,str);
return 1;
}
if(sizeof(crontab_data)>now_line)
{
write(crontab_data[now_line]+"\n: ");
now_line++;
input_to("crontab_xxx",0,str);
return 1;
}
write(crontab_data[now_line-1]+"\n: ");
now_line

Links booklink

Contact Us: admin [ a t ] ucptt.com