Linux evo.fastest-server.com 5.14.0-284.1101.el9.tuxcare.11.els11.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 14 13:30:35 UTC 2026 x86_64
LiteSpeed
Server IP : 103.249.112.113 & Your IP : 216.73.217.135
Domains : 988 Domain
User : tanishks
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
l.v.e-manager /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2026-09-04 11:42
cl-server-flags
[ DIR ]
drwxr-xr-x
2026-09-04 11:42
cl.nodejs
[ DIR ]
drwxr-xr-x
2026-09-04 11:56
cl.python
[ DIR ]
drwxr-xr-x
2026-09-04 12:16
commons
[ DIR ]
drwxr-xr-x
2026-08-11 11:38
cpanel
[ DIR ]
drwxr-xr-x
2026-09-04 11:42
directadmin
[ DIR ]
drwxr-xr-x
2026-08-11 11:38
hooks
[ DIR ]
drwxr-xr-x
2026-08-11 11:38
panelless-version
[ DIR ]
drwxr-xr-x
2026-08-11 11:38
plesk
[ DIR ]
drwxr-xr-x
2026-08-11 11:38
scriptlets
[ DIR ]
drwxr-xr-x
2026-09-04 11:42
tmp
[ DIR ]
drwxr-xr-x
2026-09-04 11:42
utils
[ DIR ]
drwxr-xr-x
2026-09-04 11:42
copy_directory.py
9.58
KB
-rw-r--r--
2026-08-11 11:38
crontab.py
6.67
KB
-rw-r--r--
2026-08-11 11:38
detect_edition_changes.py
2
KB
-rwxr-xr-x
2026-08-11 11:38
exec_command.py
4.13
KB
-rw-r--r--
2026-08-11 11:38
feature_manager.py
1.74
KB
-rw-r--r--
2026-08-11 11:38
install-lvemanager-plugin.py
64.06
KB
-rwxr-xr-x
2026-08-11 11:38
lvemanager-config.json
298
B
-rw-r--r--
2026-09-04 12:15
version
9
B
-rw-r--r--
2026-09-04 11:42
Save
Rename
# -*- coding: utf-8 -*- # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT from __future__ import print_function from __future__ import division from __future__ import absolute_import import os import re import sys import random __ALL__ = ["add_cron", "erase_cron", "remove_cron", "add_cron_task"] CRON_D = '/etc/cron.d' _CRON_FILENAME_RE = re.compile(r'^[A-Za-z0-9][A-Za-z0-9_.-]*\Z') def _cron_path(file_name): if not isinstance(file_name, str) or not _CRON_FILENAME_RE.match(file_name): raise ValueError( "Invalid cron file name %r: expected a basename matching " "[A-Za-z0-9][A-Za-z0-9_.-]*, no separator, no traversal" % (file_name,)) return os.path.join(CRON_D, file_name) def add_cron(file_name, minute, hour, day, month, day_of_week, user, command, check_command=True): """ Add new cron task into crontab schedule iff this task or command wasn't already existed in the cron-file. :param str file_name: Name of cron-file in /etc/cron.d :param minute: Integer or char 'r' if to set random minute :param hour: Integer or char 'r' if to set random hour :param int, str day: Day number :param int, str month: Month number :param int, str day_of_week: Day of week number :param str user: Under what user do run command :param str command: What command do run :param bool check_command: If it is False, check that whole cron-task line already exists in crontab, check that command string exists instead. Default is True, check a command string. """ if minute == 'r': minute = int(round(random.uniform(0, 59))) # pylint: disable=round-builtin if hour == 'r': hour = int(round(random.uniform(0, 23))) # pylint: disable=round-builtin try: cron_task = format_cron_task(minute, hour, day, month, day_of_week, user, command) except TypeError: sys.stderr.write("Can not add task with wrong syntax") add_cron_task(file_name, cron_task, check_command) def add_cron_task(file_name, task, check_command=False): """ Add new cron task in cron format iff this task or command in this task wasn't already existed in the cron-file. :param str file_name: Name of cron-file in /etc/cron.d :param str task: Cron task in format "min hour day mon d_of_w user command" :param bool check_command: If it is False, check that whole cron-task line already exists in crontab, check that command string exists instead. Default is False, check a whole cron-task string. """ cron_path = _cron_path(file_name) f = None try: f = open(cron_path, 'a+') if not is_in_cron(task, f, check_command): f.write("%s\n" % task) except (IOError, OSError): if f is not None: f.close() return False f.close() return True def remove_cron(file_name): """ Remove cron-file from fs :param str file_name: Name of cron-file in /etc/cron.d """ try: os.remove(_cron_path(file_name)) except (OSError, IOError): pass def erase_cron(file_name): """ Make cron-file empty :param str file_name: Name of cron-file in /etc/cron.d """ f = None try: f = open(_cron_path(file_name), "w") except (IOError, OSError) as err: sys.stderr.write("Can not erase crontab file %s because %s\n" % ( file_name, str(err))) if f is not None: f.close() def format_cron_task(minute, hour, day, month, day_of_week, user, command): """ Build cron-task string in the cron format :param minute: Integer or char 'r' if to set random minute :param hour: Integer or char 'r' if to set random hour :param int day: Day number :param int month: Month number :param int day_of_week: Day of week number :param str user: Under what user do run command :param str command: What command do run :return: Cron-task in the cron format :rtype: str """ arguments = (minute, hour, day, month, day_of_week, user, command) for arg in arguments: if arg is None: raise TypeError("Wrong schedule for cron task") return "%2s %2s %2s %2s %2s %10s %s" % arguments def parse_cron_task(task): """ Split cron task string into cron task parts :param str task: Cron-task string in the cron format :return: List of cron-task parts :rtype: list of str """ return task.split(None, 6) def get_task_in_cron(crontab, get_parsed=False): """ Returns iterator through crontab tasks :param iterable crontab: Iterator with crontab tasks' strings :param bool get_parsed: If it is True, return crontab task as list of task's parts return crontab task as a string instead :return: Crontab task :rtype: str :rtype: list of str """ for cron_t in (s.strip() for s in crontab): try: if get_parsed: t = parse_cron_task(cron_t) else: t = format_cron_task(*parse_cron_task(cron_t)) except TypeError: sys.stderr.write("Wrong crontab task syntax: %s\n" % cron_t) else: yield t def is_task_in_cron(task, fd): """ Find first occurence of task in cron-file if it has :param str task: Cron-task in cront format to compare with :param file fd: File descriptor of opened cron file :return: True if such a task is already existed in cron-file, False instead :rtype: bool """ for t in get_task_in_cron(fd.readlines()): if t == task: return True return False def is_command_in_cron(task, fd): """ :param str task: Task with command to looking for :param file fd: File descriptor of opened cron file :return: True if such a command is already existed in cron-file, False instead :rtype: bool Find first occurence of command in cron-file if it has """ command = parse_cron_task(task)[-1] for t in get_task_in_cron(fd.readlines(), get_parsed=True): if t[-1] == command: return True return False def is_in_cron(task, fd, check_command=False): """ Find first occurence of command or task in cron-file if it has :param str task: Task or command to looking for :param file, BinaryIO fd: File descriptor of opened cron file :param bool check_command: If it is True, check command occurence, check task occurence instead :return: True if such a command or task is already existed in cron-file, False instead :rtype: bool """ if check_command: return is_command_in_cron(task, fd) return is_task_in_cron(task, fd)