REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 1.12 KB
Close
/proc/self/root/opt/imunify360/venv/share/imunify360/scripts/delay_on_cron_call.py
Text
Base64
#!/opt/imunify360/venv/bin/python3 """ Script for internal use in cron update scripts. This script detects when parent call was maid from cron job and apply the random delay in 60 minutes """ import os import psutil import random import time MAX_SLEEP_TIME = 3600 def is_current_process_cron_child(): pid = os.getpid() try: process = psutil.Process(pid) parents = process.parents() # True for cron cronie anacron and etc.. return any(is_cron(proc.name().lower()) for proc in parents) except psutil.NoSuchProcess: print("Unable to determine parent process ID.") return False def is_cron(proc_name: str): return "cron" in proc_name and "imunify" not in proc_name def sleep_in_cron(): try: if is_current_process_cron_child(): sleep_time = random.randint(0, MAX_SLEEP_TIME) print(f"Wait for {sleep_time} seconds before starting updates") time.sleep(sleep_time) else: print("Not in cron, run update immediately") except Exception as e: print("An error occurred while waiting: ", e) sleep_in_cron()
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 12
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
migrate_csf
DIR
-
drwxr-xr-x
2026-06-08 20:23:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
check-detached.py
1.11 KB
lrwxr-xr-x
2026-05-26 21:33:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
create_default_config
1.23 KB
lrwxr-xr-x
2026-05-26 21:33:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
delay_on_cron_call.py
1.12 KB
lrwxr-xr-x
2026-05-26 21:25:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
imunify-check-pkg-integrity
5.84 KB
lrwxr-xr-x
2026-05-26 21:25:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
imunify-disable-cpu-accounting.sh
1020 B
lrwxr--r--
2026-05-26 21:33:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
imunify-doctor.sh
26.29 KB
lrwxr--r--
2026-05-26 21:33:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
imunify-force-update.sh
8.15 KB
lrwxr--r--
2026-05-26 21:33:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
purge-clamav
535 B
lrwxr-xr-x
2026-05-26 21:33:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
send-notifications
7.70 KB
lrwxrwx---
2026-05-26 21:33:49
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
setup_cagefs.py
4.48 KB
lrwx------
2026-05-26 21:25:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
track-fpfn-submissions.sh
3.80 KB
lrwxr-xr-x
2026-05-26 21:33:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
update_components_versions.py
4.08 KB
lrwxr-xr-x
2026-05-26 21:33:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).