If you are interested in a supported approach then take a look at the 
day-event.slax event script that was just added to Junoscriptorium:

http://junoscriptorium.googlecode.com/svn/trunk/library/juniper/event/utility/day-event/day-event.xml

It logs a syslog message every day in the format:

Oct 30 00:00:00  j4350 cscript: Day-Event: Fri Oct 30 00:00

So your event policies can trigger on it like this:

policy friday-policy {
    events system;
    attributes-match {
        system.message matches "Day-Event: Fri";
    }
    then {
        ...
    }
}

It runs at 00:00 by default, but can run at other times if desired, see the 
above weblink for details.

BTW, if the need is to do stateless firewall filters that change based on the 
day of week then there is already a commit+event script in Junoscriptorium that 
do all the heavy lifting for you.  With them loaded, all you need to do is add 
time-range macros to your filter terms:

     term night {
         apply-macro active-time-range {
             start-time "weekdays 17:00";
             stop-time "weekdays 20:00";
         }
         ...
     }

http://junoscriptorium.googlecode.com/svn/trunk/library/juniper/event/filters/time-based-filters/time-based-filters.xml
http://junoscriptorium.googlecode.com/svn/trunk/library/juniper/commit/filters/cs-time-based-filters/cs-time-based-filters.xml

_______________________________________________
juniper-nsp mailing list juniper-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/juniper-nsp

Reply via email to