Can someone explain me this small script
Posted: Sat Jun 01, 2013 12:50 am
:local date [/system clock get date]
:local months ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec")
:local month ([:find $months [:pick $date 0 3 ]] + 1)
:if ($month < 10) do={:set month ("0" . $month);}
:local name "$[/system identity get name].$[:pick $date 7 11].$month.$[:pick $date 4 6].backup"
/system backup save name=$name
/tool fetch address=192.168.92.10 mode=ftp upload=yes user=jeff password=test port=14147 src-path=$name dst-path=$name
---------------------------------------------
I understand what it do... but not how it do, exactly, i dont understand this line, and how extract value for variable "month"
:local month ([:find $months [:pick $date 0 3 ]] + 1)
:local months ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec")
:local month ([:find $months [:pick $date 0 3 ]] + 1)
:if ($month < 10) do={:set month ("0" . $month);}
:local name "$[/system identity get name].$[:pick $date 7 11].$month.$[:pick $date 4 6].backup"
/system backup save name=$name
/tool fetch address=192.168.92.10 mode=ftp upload=yes user=jeff password=test port=14147 src-path=$name dst-path=$name
---------------------------------------------
I understand what it do... but not how it do, exactly, i dont understand this line, and how extract value for variable "month"
:local month ([:find $months [:pick $date 0 3 ]] + 1)