Is it possible to setup a schedule to run on the 1st of every month?
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…
Thanks, I’ll give it a whirl. ![]()
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?
/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
Wouldn't that also run every day on the first month?
No, output is like this:
[martin@het-ro-a] > :put [ /system clock get date ]
sep/13/2019
This is what im looking for how can i execute this with specific time? like i want to execute this every 7:00:00 in the morning. thank you so much
:local datetime [/system clock get date];
:put $datetime;
:if ($datetime~“/01/”) do={
:set $datetime “Hari ini tanggal 01”;
} else={
:set $datetime “Bukan Tanggal 01”
};
:put $datetime
Maybe that’s what you need