My task is to specify time in CRON considering YEAR field. How can i do it, or do u know any stuff which can help me on my linux server? thx
Thankfully, you can configure a specific timezone for your Cron job as follows: First, you need to export the TZ variable in your Shell script before any other Shell entries. Next, access your crontab and use the crontab environment variable CRON_TZ at the start of the crontab file.
*/30 * * * * your_command. this means "run when the minute of each hour is evenly divisible by 30" (would run at: 1:30, 2:00, 2:30, 3:00, etc) example #3. 0,30 * * * * your_command. this means "run when the minute of each hour is 0 or 30" (would run at: 1:30, 2:00, 2:30, 3:00, etc)
Newer versions use /etc/anacrontab . By default, cron. daily scripts are run at 4:02. Editing /etc/crontab will modify that time.
Run a Cron Job Every 5 Minutes However, typing the whole list can be tedious and prone to errors. The second option to specify a job to be run every 5 minutes hours is to use the step operator: */5 * * * * command. */5 means create a list of all minutes and run the job for every fifth value from the list.
Crontab (5) file format has no YEAR field. You could try running a cron job @yearly (at 00:00 on New Year's day) which looks at the current year using date(1) and updates the current crontab file to one appropriate for the new year.
Standard cron
doesn't support a year field, but it's worth noting that some implementations support an extended crontab format with a sixth year
field, such as nnCron. Not every cron is created equal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With