Hello,
Using the Crontab is an option, but it has a drawback - if you upgrade the software, all Crontab config will be lost. Furthermore, Crontab resides outside TMOS, therefore any config in it will not be syncronized, and has to be managed separatelly on each HA cluster member.
Note1: do not forget the "REMOTEUSER = root", otherwise you will not be able to issue TMSH commands from the Crontab!
Note2: make sure you do not forget to include all the non-maintenance iRules (if you have any) since this TMSH command will replace all the existing rules with new ones. There's no "add/remove" option for the iRules in TMSH.
You can use my sample below, tweak it as needed.
crontab -e
- opens the crontab config
REMOTEUSER = root
00 01 * * Sat tmsh modify ltm virtual MyVS rules { maintenance_irule another_irule }
adds the maintenance page iRule @ 01:00 system-time on every Saturday (1 hour after midnight)
00 23 * * Sun tmsh modify ltm virtual MyVS rules { another_irule }
removes the maintenance page iRule @ 23:00 system-time on every Sunday (1 hour before midnight)
:wq
- saves the crontab config