Cron is all things considered a very basic scheduler and the syntax does not easily allow an administrator to formulate slightly more uncommon schedules. Stock cron does not have a weeknumber available, so you have to be creative.
According to ncal -w 2018
weeks 25-36 is:
May June July August September
Mo 7 14 21 28 4 11 18 25 2 9 16 23 30 6 13 20 27 3
Tu 1 8 15 22 29 5 12 19 26 3 10 17 24 31 7 14 21 28 4
We 2 9 16 23 30 6 13 20 27 4 11 18 25 1 8 15 22 29 5
Th 3 10 17 24 31 7 14 21 28 5 12 19 26 2 9 16 23 30 6
Fr 4 11 18 25 1 8 15 22 29 6 13 20 27 3 10 17 24 31 7
Sa 5 12 19 26 2 9 16 23 30 7 14 21 28 4 11 18 25 1 8
Su 6 13 20 27 3 10 17 24 1 8 15 22 29 5 12 19 26 2 9
18 19 20 21 22 22 23 24 25 26 26 27 28 29 30 31 31 32 33 34 35 35 36
One approach is to create multiple batches that combined create the schedule you want. For instance first simply select the weekdays of the last two weeks of June and then all week days of July and August in a second job and the first days of september as a third:
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
* * 18,19,20,21,22,25,26,26,28,29 jun * php /app/cmd import >> /logs/cron-offers.log
* * * jul,aug mon,tue,wed,thu,fri php /app/cmd import >> /logs/cron-offers.log
* * 3-7 9 * php /app/cmd import >> /logs/cron-offers.log
Another option is to simply run your batch daily and use the more powerful syntax of a proper programming/scripting language to let the batch process itself (i.e. your PHP code) determine if it should execute or exit immediately.