1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- from hub import Global, methods
- class JobManage(object):
- """"""
-
-
-
- @classmethod
- def run(cls):
- """启动全部任务"""
-
-
-
-
-
-
-
-
-
- @classmethod
- def end(cls):
- """暂停全部任务"""
- Global.aps.pause_all()
- @staticmethod
- def job101_on_windows():
- """
- 每日22点清理30天之前的日志
- """
- pass
- @staticmethod
- def job101_on_linux():
- """
- 每日22点清理30天之前的日志
- """
-
- log_file_dir = f"/home/server/logs"
- file_path_list = methods.get_file_path_list(log_file_dir)
- file_name_list = [i.split('/')[-1] for i in file_path_list]
-
-
- for file_name in file_name_list[30:]:
- file_path = f"/home/server/logs/{file_name}"
- if methods.is_file(file_path):
- methods.remove_file(file_path)
|