Raudel Solis
Raudel Solis

Reputation: 1

Cron Job with a Curl

I just got through the first hurdle in requesting my keys for a connection. There's other routes I can take to achieve this, however I noticed CRON jobs can do this as well.

I'm looking for guidance on building a script with about 1,000 rows that between each line waits for 400 seconds.

curl -x POST https://api.example.com/a/b/c/c.json?key=123 -d 'data=feed'
timeout 400
curl -x POST https://api.example.com/a/b/c/c.json?key=123 -d 'data=feed'
timeout 400
curl -x POST https://api.example.com/a/b/c/c.json?key=123 -d 'data=feed'

The cron job would be created with a path to the script.

Help is appreciated, It's 3 AM and I'm out of Rockstar recovery lemonade (favorite code juice).

Upvotes: 0

Views: 5304

Answers (2)

Raudel Solis
Raudel Solis

Reputation: 1

https://git-scm.com/ this was magic for my curl task, I can set and forget a job on a toaster (spare computer.)

Upvotes: 0

hanshenrik
hanshenrik

Reputation: 21483

can you wait 420 seconds instead?

*/7 * * * * curl whatever
  • albeit, if you truly need sub-minute precision, a daemon is probably a better choice.

(generated the command with https://crontab-generator.org )

Upvotes: 1

Related Questions