Popkatapetapotapulti Posted February 17, 2023 Report Posted February 17, 2023 The cron expression to run every 6 hours starting from 9 PM (i.e., at 9 PM, 3 AM, 9 AM, and 3 PM) can be written as: 0 0 21/6 * * ? correct expression evarina chepthara 0 3,9,15,21 * * * ani matram chepakandi....how can I generate for a given h0ur and interv@l ? 8 PM, 5 interval ante 8 pm, 1am, 6 am, 11 am, 4pm ravali code please Quote
Complex Posted February 17, 2023 Report Posted February 17, 2023 0 0 21/6 * * ? correct e ga every 6 hours, starting at 09:00 PM Quote
dallas_ear_rings Posted February 18, 2023 Report Posted February 18, 2023 18 minutes ago, Popkatapetapotapulti said: The cron expression to run every 6 hours starting from 9 PM (i.e., at 9 PM, 3 AM, 9 AM, and 3 PM) can be written as: 0 0 21/6 * * ? correct expression evarina chepthara 0 3,9,15,21 * * * ani matram chepakandi....how can I generate for a given h0ur and interv@l ? 8 PM, 5 interval ante 8 pm, 1am, 6 am, 11 am, 4pm ravali code please I don’t see any issue.. what I am missing? 1 Quote
Complex Posted February 18, 2023 Report Posted February 18, 2023 0 0/5 20-0 ? * * * every 5 minutes, between 08:00 PM and 12:59 AM Quote
Charger Posted February 18, 2023 Report Posted February 18, 2023 Here's an example of a cron job code that will start at 8AM, then start a second job 6 hours later at 2PM, and continue with 3 more jobs at 8-hour intervals: javascriptCopy code 0 8 * * * /path/to/job1.sh 0 14 * * * /path/to/job2.sh 0 22 * * * /path/to/job3.sh 0 6,14 * * * /path/to/job4.sh 0 0,8,16 * * * /path/to/job5.sh In this example, the first job will start at 8AM every day, as specified by 0 8 * * *. The second job will start 6 hours later at 2PM, as specified by 0 14 * * *. The third job will start at 10PM (8 hours after the second job), as specified by 0 22 * * *. The fourth job will start at 6AM and 2PM every day (8 hours after the third and second jobs, respectively), as specified by 0 6,14 * * *. Finally, the fifth job will start at midnight, 8AM, and 4PM every day (8 hours after the fourth job, and 16 hours after the first job), as specified by 0 0,8,16 * * *. Make sure to replace the paths to the job scripts with the correct paths on your system, and ensure that the scripts have the correct permissions to be executed as cron jobs. You can also adjust the timing and frequency of the jobs by modifying the cron job code. Regenerate response Quote
Popkatapetapotapulti Posted February 18, 2023 Author Report Posted February 18, 2023 20 minutes ago, Complex said: 0 0 21/6 * * ? correct e ga every 6 hours, starting at 09:00 PM next execution times for this expression are Sat Feb 18 21:00:00 UTC 2023 Sun Feb 19 21:00:00 UTC 2023 Mon Feb 20 21:00:00 UTC 2023 Tue Feb 21 21:00:00 UTC 2023 Wed Feb 22 21:00:00 UTC 2023 Thu Feb 23 21:00:00 UTC 2023 but what I want is Sat Feb 18 21:00:00 UTC 2023 Sun Feb 19 03:00:00 UTC 2023 Sun Feb 19 09:00:00 UTC 2023 Sun Feb 19 15:00:00 UTC 2023 Sun Feb 1921:00:00 UTC 2023 Quote
Popkatapetapotapulti Posted February 18, 2023 Author Report Posted February 18, 2023 21 minutes ago, dallas_ear_rings said: I don’t see any issue.. what I am missing? next execution times for this expression are Sat Feb 18 21:00:00 UTC 2023 Sun Feb 19 21:00:00 UTC 2023 Mon Feb 20 21:00:00 UTC 2023 Tue Feb 21 21:00:00 UTC 2023 Wed Feb 22 21:00:00 UTC 2023 Thu Feb 23 21:00:00 UTC 2023 but what I want is Sat Feb 18 21:00:00 UTC 2023 Sun Feb 19 03:00:00 UTC 2023 Sun Feb 19 09:00:00 UTC 2023 Sun Feb 19 15:00:00 UTC 2023 Sun Feb 1921:00:00 UTC 2023 Quote
Popkatapetapotapulti Posted February 18, 2023 Author Report Posted February 18, 2023 17 minutes ago, Charger said: Here's an example of a cron job code that will start at 8AM, then start a second job 6 hours later at 2PM, and continue with 3 more jobs at 8-hour intervals: javascriptCopy code 0 8 * * * /path/to/job1.sh 0 14 * * * /path/to/job2.sh 0 22 * * * /path/to/job3.sh 0 6,14 * * * /path/to/job4.sh 0 0,8,16 * * * /path/to/job5.sh In this example, the first job will start at 8AM every day, as specified by 0 8 * * *. The second job will start 6 hours later at 2PM, as specified by 0 14 * * *. The third job will start at 10PM (8 hours after the second job), as specified by 0 22 * * *. The fourth job will start at 6AM and 2PM every day (8 hours after the third and second jobs, respectively), as specified by 0 6,14 * * *. Finally, the fifth job will start at midnight, 8AM, and 4PM every day (8 hours after the fourth job, and 16 hours after the first job), as specified by 0 0,8,16 * * *. Make sure to replace the paths to the job scripts with the correct paths on your system, and ensure that the scripts have the correct permissions to be executed as cron jobs. You can also adjust the timing and frequency of the jobs by modifying the cron job code. Regenerate response edi ela generate chestav 0,8,16 * * * programatical ga lets say it starts at 21 every 6 hours then you want 0 3,9,15,21 * * * Quote
k2s Posted February 18, 2023 Report Posted February 18, 2023 53 minutes ago, Popkatapetapotapulti said: The cron expression to run every 6 hours starting from 9 PM (i.e., at 9 PM, 3 AM, 9 AM, and 3 PM) can be written as: 0 0 21/6 * * ? correct expression evarina chepthara 0 3,9,15,21 * * * ani matram chepakandi....how can I generate for a given h0ur and interv@l ? 8 PM, 5 interval ante 8 pm, 1am, 6 am, 11 am, 4pm ravali code please The cron expression to run every 6 hours starting from 9 PM can be written as: 0 0 21/6 * * ? 0 0 21/6 * * ? This expression has five parts: 0 0: this specifies that the cron job should run at 0 minutes and 0 seconds past the hour. 21/6: this specifies that the cron job should run starting at hour 21 (which is 9 PM in 24-hour time) and every 6 hours thereafter. *: this specifies that the cron job should run on every day of the month. *: this specifies that the cron job should run on every month of the year. ?: this specifies that the cron job should not run on any specific day of the week. In other words, the day of the week is not used to determine when the job should run. So the final cron expression is 0 0 21/6 * * ?, which means that the cron job will run every 6 hours starting from 9 PM. Quote
Charger Posted February 18, 2023 Report Posted February 18, 2023 29 minutes ago, Popkatapetapotapulti said: edi ela generate chestav 0,8,16 * * * programatical ga lets say it starts at 21 every 6 hours then you want 0 3,9,15,21 * * * 0 21 * * * /path/to/job1.sh 0 2 * * * /path/to/job2.sh 0 7 * * * /path/to/job3.sh 0 12 * * * /path/to/job4.sh 0 17 * * * /path/to/job5.sh This cron job will start the first job at 9 PM (21:00), and then run the subsequent jobs at 2 AM, 7 AM, 12 PM, and 5 PM. You'll need to replace "/path/to/job1.sh" with the actual path to the script or command that you want to run for each job. Quote
Charger Posted February 18, 2023 Report Posted February 18, 2023 32 minutes ago, Popkatapetapotapulti said: edi ela generate chestav 0,8,16 * * * programatical ga lets say it starts at 21 every 6 hours then you want 0 3,9,15,21 * * * dentlo kavali niku, i mean which prog, laguage. Quote
ramudu Posted February 18, 2023 Report Posted February 18, 2023 1 hour ago, Popkatapetapotapulti said: The cron expression to run every 6 hours starting from 9 PM (i.e., at 9 PM, 3 AM, 9 AM, and 3 PM) can be written as: 0 0 21/6 * * ? correct expression evarina chepthara 0 3,9,15,21 * * * ani matram chepakandi....how can I generate for a given h0ur and interv@l ? 8 PM, 5 interval ante 8 pm, 1am, 6 am, 11 am, 4pm ravali code please http://www.cronmaker.com/ use this , you can generate or test your corn expression Quote
jalsa01 Posted February 18, 2023 Report Posted February 18, 2023 0 3,9,15,21 * * * or 0 21,3/6 * * * Quote
dasari4kntr Posted February 18, 2023 Report Posted February 18, 2023 11 minutes ago, reality said: seems it is true.. @hunkyfunky2 also posted this… Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.