Good Morning Mikrotik Community,
Does anyone know if there’s a way to get weekday (either as a number or a word, I don’t really care at this stage) from the current date in a MikroTik script.
In my current automatic backup script, I have:
:local theDate [/system clock get date]
:local theDay [ :pick \$theDate 4 6 ]
I can see that the :pick just extracts parts of the date string.
At the moment, my automatic backup script just creates a new config export every day and then I have a small .NET program running on server on our network which logs in with SSH and downloads it.
What I would like to have is something a bit more like the backup regime that I have for other systems:
- A backup is taken every day, but these are only kept for 1 week, i.e. the Monday config export would be overwritten every Monday, the Tuesday overwritten every Tuesday etc.
- Additionally, a backup is taken every Monday, but this time kept for 1 week, and the files are recycled every month, giving me Week1, Week2 etc.
- Additionally, a backup is taken on the 1st of every month, and these backups are kept for 1yr before being recycled.
I can work out how to do the “1st of the Month” bit, but can’t find anything in the help.mikrotik or wiki.mikrotik on how to get the Weekday out of the date.
If it’s not possible to get Weekday, then I will just edit the script to do a daily backup each day of the month and then one on the first of the month and recycle these files acordngly, as I can work out how to do this from what I’ve already got.
Any help gratefully received.
Thanks
Colin

