I would like to develop a script that enables the deletion of my log files.
However, I would like them to be deleted only if they are older than one year compared to the mikrotik’s date.
Below, I present the script I have attempted to create, but unfortunately, it does not produce the expected results.
Do you have suggestions ?
:global time [/system clock get time]
:global logskeep 31536000000
:foreach file in=[/file find] do={
:global filename [/file get $file name]
:global filetime [/file get $file creation-time]
:global timedifference ($time - $file_time)