Hirdetés

Új hozzászólás Aktív témák

  • m0ski

    aktív tag

    válasz vmk #14480 üzenetére

    Szia!

    Én az alábbi scriptet használom, a tiédhez hasonlóan ugyanúgy benne lesz a dátum is a fájlnévben.

    ###### months array
    :local months ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");

    ###### get time
    :local ts [/system clock get time]
    :set ts ([:pick $ts 0 2].[:pick $ts 3 5].[:pick $ts 6 8])

    ###### get Date
    :local ds [/system clock get date]

    ###### convert name of month to number
    :local month [ :pick $ds 0 3 ];
    :local mm ([ :find $months $month -1 ] + 1);
    :if ($mm < 10) do={ :set mm ("0" . $mm); }

    ###### set $ds to format YYYY-MM-DD
    :set ds ([:pick $ds 7 11] . $mm . [:pick $ds 4 6])

    ###### get system name
    :local sysname [/system identity get name];

    ###### create filename
    :local filename ([$sysname]."-".[$ds]."-".[$ts].".backup")

    ###### create backup file
    /system backup save name=$filename;

    ###### upload file via FTP
    /tool fetch address=192.168.0.2 src-path="$filename" user=user mode=ftp password=pass dst-path=("mikrotik/$filename") upload=yes

Új hozzászólás Aktív témák