Skip to content

Commit 5f4622f

Browse files
committed
Update init_cron.py
1 parent 9664609 commit 5f4622f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Diff for: web/admin/setup/init_cron.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,22 @@ def init_cron():
2727

2828
if file == "":
2929
return True
30-
31-
# content = mw.execShell("crontab -l")
30+
3231
with open(file) as f:
3332
for line in f.readlines():
3433
cron_line = line.strip()
3534
if cron_line.startswith("#"):
3635
continue
37-
print(cron_line)
36+
37+
cron_expression = cron_line.split(maxsplit=5)[0] # 提取前 5 个字段(* * * * *)
38+
command = cron_line.split(maxsplit=5)[5] # 提取命令部分
39+
40+
# 面板计划任务过滤
41+
if command.startswith("/www/server/cron"):
42+
continue
43+
44+
45+
print(command)
3846

3947
# cron_list = content.split("\n")
4048
# print(cron_list)

0 commit comments

Comments
 (0)