I have a media file that I would like to present to users on my site based on time of day. I would like to use a CRON job to rename the files so that I can easily manage the media being displayed.
i.e.
default media displayed on site is default.mp4
default.mp4 renamed to 0.mp4 at 03:00 and 1.mp4 is renamed to default.mp4
default.mp4 renamed to 1.mp4 at 03:00 and 2.mp4 renamed to default.mp4
default.mp4 renamed to 2.mp4 at 03:00 and 3.mp4 renamed to default.mp4
and so on....
what is the CRON job syntax for this?
To run a script at 03:00 every day:
0 3 * * * *
Though I'm guessing you copy-pasted those lines & neglected to update the time, as what you're asking will cause multiple files to be renamed default.mp4
at the same time.
Here's a good site for explaining CRON syntax: http://www.nncron.ru/help/EN/working/cron-format.htm
This is a good one for testing: https://crontab.guru/