diff --git a/.env.tmpl b/.env.tmpl index 83c9de4..14b4d3c 100644 --- a/.env.tmpl +++ b/.env.tmpl @@ -6,10 +6,10 @@ PYTHON_BIN=/usr/bin/python3 # Absolute path where the repo is installed # (directory that contains run_backup.py) -BACKUP_INSTALL_DIR=/usr/local/kvm-backup +BACKUP_INSTALL_DIR=/home/ubuntu/Documents/kvm-backup # Name of the python entrypoint file BACKUP_RUNNER=run_backup.py # Optional: fixed wrapper path (recommended) -WRAPPER_PATH=/usr/local/bin/run-kvm-backup \ No newline at end of file +WRAPPER_PATH=/usr/local/bin/run-kvm-backup diff --git a/run_backup.py b/run_backup.py index 6c06af1..3b66c33 100755 --- a/run_backup.py +++ b/run_backup.py @@ -7,13 +7,15 @@ import os # ================= CONFIG ================= +SCRIPT_DIR = pathlib.Path(__file__).resolve().parent + SCRIPTS = [ - "backup_configs.sh", - "backup_home.sh", - "backup_vms.sh", + SCRIPT_DIR / "backup_configs.sh", + SCRIPT_DIR / "backup_home.sh", + SCRIPT_DIR / "backup_vms.sh", ] -LOG_DIR = "job-runner" +LOG_DIR = SCRIPT_DIR / "job-runner" # ========================================== @@ -34,7 +36,7 @@ def run_script(script_path, run_ts): with open(out_file, "wb") as out, open(err_file, "wb") as err: proc = subprocess.Popen( - ["/bin/bash", script_path], + ["/bin/bash", str(script_path)], stdout=out, stderr=err, env={