I would like my backup in a subfolder. However, because of the variable, an error always occurs. How can one solve it?
/system backup save name=/backup/$backupName
local name [/system identity get name];
:local date [/system clock get date];
:local day [ :pick $date 4 6 ]
:local month [ :pick $date 0 3 ]
:local backupName ($name.“_”.$day.“-”.$month.“_log”);
:put $backupName
/system backup save name=/backup/$backupName
I was able to solve the Problem with.
/tool fetch > https://127.0.0.1/ > dst-path=backup/mikrotik
Thank you
Can be a solution, but you are forced to leave http(s) service active or enable/disable for use that function.
(Obviously you can use external website and “solve” this “problem”)
This is better, also contain corrections on coding…:
{
/system
:local name [identity get name]
:local date [clock get date]
:local day [:pick $date 4 6]
:local month [:pick $date 0 3]
:local folderName "/backup"
:local backupName "$folderName/$name_$day-$month_log"
:put $backupName
/ip smb shares
:local temp [get [find default=yes] directory]
set [find default=yes] directory=$folderName
set [find default=yes] directory=$temp
/system backup save name="$backupName"
}
Guys,
I’m trying to save a “rsc” backup to a subfolder, and I can’t do it, here’s my script
{
:local name "750GL(SERVER)"
:local fname "RB"
:local backupname "$fname$name"
/ip smb shares
:local temp [get [find default=yes] directory]
set [find default=yes] directory=$fname
set [find default=yes] directory=$temp
export compact file=$backupname
}
Thanks for the help friends.
EL DONCITO.
where are the /?
and about the ( and ) on name, I do not know if are allowed or not on filename (probably yes)…
Solved friend Rextended
{
:local name "750GL(SERVER)"
:local fname "RB"
:local backupname "$fname/$name"
/ip smb shares
:local temp [get [find default=yes] directory]
set [find default=yes] directory=$fname
set [find default=yes] directory=$temp
/export compact file=$backupname
}
EL DONCITO.