Does anyone know of a script that will export the config and download it to specified folder on a Windows PC running Winbox?
I see the fetch command, but I don't want to always run an ftp server on my PC.
Thanks!
tool fetch address=192.168.2.22 src-path=212hex-12-9-2022.rsc user=mikrotik mode=ftp passwo
rd=mikrotik dst-path=212hex-12-9-92022.rsc port=21 host="" upload=yes
tool fetch address=192.168.2.22 src-path=212hex*.rsc user=mikrotik mode=ftp passwo
rd=mikrotik dst-path=212hex*.rsc port=21 host="" upload=yes
# for v6
/export file=exportthis
# for v7
/export show-sensitive file=exportthis
/tool fetch upload=yes mode=ftp ascii=no src-path="/exportthis.rsc" dst-path="212hex-2022-12-13.rsc" \
address=192.168.2.22 port=21 user=mikrotik password=mikrotik
:global nowdate do={
/system clock
:local vdate [get date]
:local yyyy [:pick $vdate 7 11]
:local M ([:find "xxanebarprayunulugepctovecANEBARPRAYUNULUGEPCTOVEC" [:pick $vdate 1 3] -1] / 2); :if ($M>12) do={:set M ($M - 12)}
:local MM [:pick "0$M" 1 3]
:local dd [:pick $vdate 4 6]
:return "$yyyy-$MM-$dd"
}
# for v6
/export file="exportthis-$[$nowdate]"
# for v7
/export show-sensitive file="exportthis-$[$nowdate]"
/tool fetch upload=yes mode=ftp ascii=no src-path="/exportthis-$[$nowdate].rsc" dst-path="/<PUT-THE-FOLDER-NAME-HERE-NOT-THE-FILENAME>" \
address=192.168.2.22 port=21 user=mikrotik password=mikrotik
dst-path="/212hex/exportthis-$[$nowdate].rsc"
/tool fetch upload=yes mode=ftp ascii=no src-path="/212hex-$[$nowdate].rsc" dst-path="/212hex/212hex-$[$nowdate].rsc" address=192.168.2.22 port=21 user=mikrotik password=mikrotik
/tool fetch upload=yes mode=ftp ascii=no src-path="/212hex-$[$nowdate].rsc" dst-path="/212hex/" address=192.168.2.22 port=21 user=mikrotik password=mikrotik