I need a Cron that runs everyday that calls an API, following the documentation I made it like this:
- Is the use of the shortcut done properly or should I just use 0 0 * * *
- And more importantly is the api call done correctly? Or do I need a special parameter, or run a sh that does the call itself?
I'm not sure if CRON of OpenWRT recognizes keywords like
@daily anyway you can try if it does work.. but just calling a URL won't work since OpenWRT (or linux) won't understand it since it is not a command, you can use
wget before the url of the API.
Ok, do note that by default OpenWRT doesn't come with curl, so I had to install it. Tried the command by ssh and it seems to work fine.
While wget does come by default, it downloads the page and I think that works, but for the sake of logging and not creating useless files, it's better to use curl.
Just to be sure I changed the cron to 0 0 * * *. So this should work fine now. Just for curiosity I would like to know how the shortcuts (@yearly @daily, etc) work.
-O switch for wget to redirect the output elsewhere, e.g.
wget -O /dev/null http://example.org/api
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.