Files
CyberPanel/IncBackups/IncScheduler.py
master3395 c7995ecf03 Fix missing /usr/local/CyberCP/bin/python for cron and IncBackups
Add plogical/cyberpanel_python.py with resolve_cyberpanel_python() and
ensure_cyberpanel_bin_python_shim() (symlink to system Python when venv
binary is absent). Call shim before writing root crontab on install/upgrade,
and from IncBackups/IncScheduler.py so existing jobs self-heal. IncBackups
views use resolved interpreter for backupUtilities. Upgrade._python_for_manage
delegates to resolve_cyberpanel_python().
2026-04-12 02:54:08 +02:00

26 lines
764 B
Python

import argparse
import sys
sys.path.append("/usr/local/CyberCP")
from plogical.cyberpanel_python import ensure_cyberpanel_bin_python_shim, resolve_cyberpanel_python
from plogical.processUtilities import ProcessUtilities
def main():
try:
ensure_cyberpanel_bin_python_shim()
except BaseException:
pass
parser = argparse.ArgumentParser(description="CyberPanel incremental backup cron wrapper")
parser.add_argument("function", help="Function name to pass to plogical/IncScheduler.py")
args = parser.parse_args()
py = resolve_cyberpanel_python()
command = "%s /usr/local/CyberCP/plogical/IncScheduler.py '%s'" % (py, args.function)
ProcessUtilities.normalExecutioner(command)
if __name__ == "__main__":
main()