Forum Discussion

P_C_386681's avatar
P_C_386681
Icon for Nimbostratus rankNimbostratus
Apr 02, 2019

how to schedule to display web page maintenance every month ?

I want to schedule to display web page maintenance every month use irule. could someone share your template for my reference ? Thanks

 

2 Replies

  • Whilst it's possible, iRules are event driven so it's not very practical to schedule them to display something at a certain time. It might be easier to automate applying a different iRule to the virtual server at the times you want to display the maintenance page

     

  • Hi PC,

    You can trig your maitenance page using Irule above:

    when HTTP_REQUEST {
       "clock seconds" will return the time in seconds
       "clock format" will format the previous value with it's date/time components
       split will chop the returned string into a list of elements.
      set l [split [clock format [clock seconds] -format {%A %H}] " "]
    
       Next add the time check logic:
       This example will process the log statement on Sunday between 3 and 4am.
      if { ([lindex $l 0] eq "Sunday") &&
           ([lindex $l 1] >= 3) &&
           ([lindex $l 1] < 4)  } {
         Put in iRule logic here
        log local0. "processing iRule..."
      }
    }
    

    For info i retrieve the irule in this post:

    https://devcentral.f5.com/questions/schedule-an-irule-for-specific-date-time