How can i set three cron jobs for every two days interval but not runs all.
This is is my three cron job process:
0 20 */2 * * /usr/local/bin/ruby /var/www/html/data_download1.rb >/dev/null 2>&1
0 20 */2 * * /usr/local/bin/ruby /var/www/html/data_download2.rb >/dev/null 2>&1
0 20 */2 * * /usr/local/bin/ruby /var/www/html/data_download3.rb >/dev/null 2>&1
You can use
1-31/2for one task and2-30/2for the other to specify alternating days. This will fail on months with odd numbers of days as the1-31/2job will run twice in a row.If you absolutely must have it right, you can check whether the number of days since a particular date is odd or even and have one script abort if it’s odd and the other abort if it’s even.