Skip to content

Instantly share code, notes, and snippets.

@lhns
Created October 27, 2025 17:14
Show Gist options
  • Select an option

  • Save lhns/cf7392ecbf2910e75bdda5ffa67be5c8 to your computer and use it in GitHub Desktop.

Select an option

Save lhns/cf7392ecbf2910e75bdda5ffa67be5c8 to your computer and use it in GitHub Desktop.
# perms: ftp, read, policy, sensitive, write, test
:local addr ""
:local port "21"
:local user "mikrotik"
:local pass ""
:local systemname [/system identity get name]
:local time [/system clock get time]
:local prefix ($systemname.".".[/system clock get date]."T".[:pick $time 0 2].[:pick $time 3 5].[:pick $time 6 8])
/system backup save name=$systemname
/tool fetch mode=ftp address=$addr port=$port src-path="$systemname.backup" dst-path="$prefix.backup" upload=yes user=$user password=$pass
/export file=$systemname
/tool fetch mode=ftp address=$addr port=$port src-path="$systemname.rsc" dst-path="$prefix.rsc" upload=yes user=$user password=$pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment