mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-25 10:20:06 +02:00
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().
26 lines
764 B
Python
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()
|