import subprocess import time # === Configuration === php_path = r"C:\wamp64\bin\php\php8.3.14\php.exe" project_path = r"C:\wamp64\www\alrahma_school_sunday" command = f'"{php_path}" "{project_path}\\spark" users:delete-inactive-users' # === Loop Settings === interval_seconds = 60 * 15 # Run every 5 minutes (change as needed) while True: try: print("\nšŸ• Running delete-inactive-users command...") subprocess.run(command, check=True, shell=True) print("āœ… Command executed successfully.") except subprocess.CalledProcessError as e: print("āŒ Failed to run the command.") print(e) print(f"ā³ Waiting {interval_seconds} seconds before next run...\n") time.sleep(interval_seconds) #/var/lib/vz/dump/vzdump-lxc-104-2025_05_27-02_51_09.tar.zst'