0

This Crontab Day of the Week syntax does not provide a solution.

I have a cron job set; using wget to download a file & generate a report.

What should I do to amend the script so that if the file on the server hasn't been updated yet, it tries the job again after 15 minutes?

  • You can write a script in bash/python that runs every fifteen minutes, and only generates the report if the file has changed. `wget url; if ! [ -f old-file ] || ! cmp file old-file ; then generatereport(); fi; mv file old-file` – andrewdotn Mar 19 '21 at 01:23
  • So presume you are stuck on scheduling every 15 mins? You can put multiple values in each of the fields... e.g `0,15,30,45 * * * * /your/script....` (that's run the cron job on the hour, 15 past the hour, half past, quarter to the hour) or more neatly `*/15 * * * *...` see https://en.wikipedia.org/wiki/Cron which was in answers for the article linked to the OP. – Mr R Mar 20 '21 at 06:35
  • I'm going to look into these suggestions. Thank you peeps. – ToddMcCullough Mar 20 '21 at 14:15

0 Answers0