ACIL FM
Dark
Refresh
Current DIR:
/opt/imunify360/venv/share/imunify360/scripts
/
opt
imunify360
venv
share
imunify360
scripts
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
migrate_csf
-
chmod
Open
Rename
Delete
check-detached.py
1.11 MB
chmod
View
DL
Edit
Rename
Delete
create_default_config
1.23 MB
chmod
View
DL
Edit
Rename
Delete
delay_on_cron_call.py
1.12 MB
chmod
View
DL
Edit
Rename
Delete
imunify-disable-cpu-accounting.sh
1 MB
chmod
View
DL
Edit
Rename
Delete
imunify-doctor.sh
17.29 MB
chmod
View
DL
Edit
Rename
Delete
imunify-force-update.sh
3.4 MB
chmod
View
DL
Edit
Rename
Delete
purge-clamav
539 B
chmod
View
DL
Edit
Rename
Delete
send-notifications
15.07 MB
chmod
View
DL
Edit
Rename
Delete
setup_cagefs.py
4.48 MB
chmod
View
DL
Edit
Rename
Delete
track-fpfn-submissions.sh
3.8 MB
chmod
View
DL
Edit
Rename
Delete
update_components_versions.py
4.08 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /opt/imunify360/venv/share/imunify360/scripts/delay_on_cron_call.py
#!/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()
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply