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?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...
/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?:if ([/system clock get date]~"/01/") do={
#place instructions here
};
[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 muchCode: Select all/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