Have any of you added a Node script to a cron job?

Have any of you added a Node script to a cron job? I’ve been trying, but so far no luck… I made the script executable, and added #!/usr/bin/env node at the top… Then put it in my cron file… But nothing? Am I missing something?

You’d need to include the details of what you tried. A full email to the support list and then pinging me is a great way to get an answer. Have you looked at using the ‘autorun’ folder instead? I have a systemd started node task running that monitors that folder for JavaScript files and runs them with node.

I use the autorun folder for some stuff, but for this script I need it to run everyday at 4am, so it’s more in the realm of cron. (At least I think…)

I’ll put together an email. Thanks. :slight_smile:

Ok I did a little sniffing and got it working… Apparently if you want to run your node script from Cron, you need to be sure ALL modules you require are listed with their full path, even the Global modules that you normally don’t need to list a path for. Once I went back through and gave the script the path to all required modules it worked just fine.