How can LINUX schedule tasks be executed once an hour during working hours? It will be executed every two hours outside working hours.

  linux, question

During working hours: from 09: 00 to 17: 00, it will be executed once an hour.
Outside working hours: once every two hours from 18: 00 to 08: 00
Saturday and Sunday are all non-working hours.

Can this be achieved with crontab?

# During working hours
 * 9-17/1 * * 1,2,3,4,5 /path/to/your/script
 # Outside Working Hours
 * 18-8/2 * * 6,0    /path/to/your/script