-1

I have a URL, which calls some API and does some operations, I need this url to be clicked once a day. Can I use cron jobs, if so how? I tried the usual sites and methods, but they all make an API call. I need it to click my link.

Any help is appreciated, thank you

Dominik
  • 6,078
  • 8
  • 37
  • 61

1 Answers1

0

Open cron via crontab -e and add a line like the below:

0 1 * * * node path/to/my_script_that_clicks_on_webpages.js

(make sure your script is executable)

More about scheduling with cron here: https://crontab.guru/#0_1_*_*_*

Your next question might be HOW to "click a URL" (as you put it) via a node script (or any other script) but I think that's a separate question. (spoilers: you should use something like playwright to click on a link)


For extra credit make sure you log the output of the script you're running via:

0 1 * * * node path/to/my_script_that_clicks_on_webpages.js >> /var/log/your_log.log 2>&1
Dominik
  • 6,078
  • 8
  • 37
  • 61