[閒聊] 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