benmmonster Posted October 9, 2023 Posted October 9, 2023 I want to run a task for every day to update my database. I noticed that heliohost offeres a scheduled task function in plesk. I was trying that and I tries `node update.js`, `npx node update.js` & npx run update (Script in my package.json that runs npx node update.js) and it returns a command not found error. Is it possible to use this function for node.js?
wolstech Posted October 10, 2023 Posted October 10, 2023 I'd imagine it's possible, but I know there's limitations on what commands the scheduler can see for security. Krydos can answer this in much better detail than I ever could.
Krydos Posted October 10, 2023 Posted October 10, 2023 Cron jobs are chrooted and node executable doesn't exist within your chroot. In order to run a node cron you'd need to make a cgi script that runs the node command and use the cron to call the cgi.
benmmonster Posted October 10, 2023 Author Posted October 10, 2023 Okay. I am going to see about having it fetch a webpage and set that to be the trigger.
Recommended Posts