F5配置irule,使其系统在X个时间段提供服务,其余时间显示维护页面

##F5使系统在X个时间内不提供服务,只显示维护页面
when HTTP_REQUEST {
  set curtime [clock seconds]
  set formattime [clock format $curtime -format {%H}]
 #abc专用POOL
 if { [HTTP::uri]  starts_with "/abc" } {
     pool  pool_abc #abc网站正常提供服务
 }
 else {
   #早8点至晚20点提供服务,其余时间显示维护页面
   if {$formattime >= 8 && $formattime < 20} {
     pool yw_pool
     }
    else {
        pool wh_pool
       }
 }

 }

 

时间的格式化参数如下:

%% Insert a %.

%a Abbreviated weekday name (Mon, Tue, etc.).

%A Full weekday name (Monday, Tuesday, etc.).

%b Abbreviated month name (Jan, Feb, etc.).

%B Full month name.

%c Locale specific date and time.

%d Day of month (01 - 31).

%H Hour in 24-hour format (00 - 23).

%I Hour in 12-hour format (00 - 12).

%j Day of year (001 - 366).

%m Month number (01 - 12).

%M Minute (00 - 59).

%p AM/PM indicator.

%S Seconds (00 - 59).

%U Week of year (01 - 52), Sunday is the first day of the week.

%w Weekday number (Sunday = 0).

%W Week of year (01 - 52), Monday is the first day of the week.

%x Locale specific date format.

%X Locale specific time format.

%y Year without century (00 - 99).

%Y Year with century (e.g. 1990)

%D Date as %m/%d/%y.

%e Day of month (1 - 31), no leading zeros.

%h Abbreviated month name.

%n Insert a newline.

%r Time as %I:%M:%S %p.

%R Time as %H:%M.

%t Insert a tab.

%T Time as %H:%M:%S.

转载于:https://my.oschina.net/farces/blog/1541157

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值