Community discussions

 
rae
newbie
Topic Author
Posts: 33
Joined: Fri Jul 04, 2014 5:17 pm

Schedule for 1st of every month

Fri Jul 11, 2014 5:39 pm

Is it possible to setup a schedule to run on the 1st of every month?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 2946
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: Schedule for 1st of every month

Fri Jul 11, 2014 5:42 pm

FASSSSSSSSSSSSSSSSST RESPONSE:

Not directly.

Run one script each midnight and if day=01 execute the rest of the script

:if ([/system clock get date]~"/01/") do={
#place instructions here
};

Ohhhhhh... Near everytime I solve one problem for another user, I give some new idea... thanks mikrotik forum...
I'm Italian, not English. Sorry for my imperfect grammar.
 
rae
newbie
Topic Author
Posts: 33
Joined: Fri Jul 04, 2014 5:17 pm

Re: Schedule for 1st of every month

Sat Jul 12, 2014 12:07 pm

Thanks, I'll give it a whirl. :)
 
projectdimpreza
just joined
Posts: 2
Joined: Thu Jul 11, 2019 6:37 pm

Re: Schedule for 1st of every month

Thu Sep 12, 2019 12:15 pm

FASSSSSSSSSSSSSSSSST RESPONSE:

Not directly.

Run one script each midnight and if day=01 execute the rest of the script

:if ([/system clock get date]~"/01/") do={
#place instructions here
};

Ohhhhhh... Near everytime I solve one problem for another user, I give some new idea... thanks mikrotik forum...
im new to scripting.. and this is one of my problem.. can u show me a script to run every 9th of the month.. then.. disable a specific ppp secret user.. then if its active .. delete it from active ppp connection?
 
marting
Member Candidate
Member Candidate
Posts: 147
Joined: Thu Aug 21, 2014 2:07 pm

Re: Schedule for 1st of every month

Thu Sep 12, 2019 1:44 pm

/system scheduler
add interval=1d name=disableUserSecrets on-event=":local usersToDisable [:toarray \"martin, thomas\"]\r\
    \n:local dayToDisable \"09\"\r\
    \n\r\
    \n:if ( [ :pick [ /system clock get date ] 4 6  ] = \$dayToDisable ) do={\r\
    \n    :foreach user in \$usersToDisable do {\r\
    \n        :log info \"disabling ppp secret '\$user' and killing active connections\"\r\
    \n        /ppp secret disable [ find name=\$user ]\r\
    \n        /ppp active remove [ find name=\$user ]\r\
    \n    }\r\
    \n}" policy=read,write start-date=jan/01/2019 start-time=00:00:01
 
savage
Forum Guru
Forum Guru
Posts: 1197
Joined: Mon Oct 18, 2004 12:07 am
Location: Cape Town, South Africa
Contact:

Re: Schedule for 1st of every month

Thu Sep 12, 2019 3:38 pm

:if ([/system clock get date]~"/01/") do={
#place instructions here
};
Wouldn't that also run every day on the first month?
Regards,
Chris
 
marting
Member Candidate
Member Candidate
Posts: 147
Joined: Thu Aug 21, 2014 2:07 pm

Re: Schedule for 1st of every month

Fri Sep 13, 2019 2:00 pm

No, output is like this:
[martin@het-ro-a] > :put [ /system clock get date ]               
sep/13/2019

Who is online

Users browsing this forum: Bing [Bot] and 51 guests