Page 1 of 1

SD card backup

Posted: Thu Nov 10, 2016 2:17 pm
by ahmedakkaya
Hello there
micro SD card into i back up a script

Image

Re: SD card backup

Posted: Thu Nov 10, 2016 3:35 pm
by proximus
/system backup save name="/disk1/backup_name"
Even better, this nice backup script continues on to ftp the backup to another destination.
http://harry.subnetworx.de/2013/12/27/a ... ackup-ftp/
But, you could strip out the the ftp and local file delete parts. That would leave you with unique file names on the SD each time it runs.
You would have to edit the file destination to use disk1, like this:
/system backup save name="/disk1/$fname1"
:log info message="System backup finished.";
/export compact file="/disk1/$fname2"

Re: SD card backup

Posted: Thu Nov 10, 2016 6:21 pm
by ahmedakkaya
/system backup save name="/disk1/backup_name"
Even better, this nice backup script continues on to ftp the backup to another destination.
http://harry.subnetworx.de/2013/12/27/a ... ackup-ftp/
But, you could strip out the the ftp and local file delete parts. That would leave you with unique file names on the SD each time it runs.
You would have to edit the file destination to use disk1, like this:
/system backup save name="/disk1/$fname1"
:log info message="System backup finished.";
/export compact file="/disk1/$fname2"
Thank you :D

Re: SD card backup

Posted: Thu Nov 10, 2016 9:35 pm
by Rudios
I would go for the export feature!
The big downside to making a backup is that it could only be restored on the same type device, with exact same RouterOS version.
When creating an export (rsc file) you could alter fhe file if needed and load it on practical any replacement device when needed.

[EDIT]
I have put together this script a while back and it integrates the date and device's identity.
#************************************************************************************************
# Parameters
#************************************************************************************************

# First get the identity for the Export file name
:local ConfigExportName [/system identity get name]

# get current date in format mm/DD/YYYY
:local date [ /system clock get date ]

# convert to YYYYMMDD
:local months ("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");
:local month [ :pick $date 0 3 ]; :local day [ :pick $date 4 6 ]; :local year [ :pick $date 7 11 ];
:local mm ([ :find $months $month -1 ] + 1);
:if ($mm < 10) do={ :set month ("0" . $mm); } else={ :set month $mm; }
:set date ($year . "-" . $month . "-" .  $day);

:set ConfigExportName ($ConfigExportName . "_" . $date);

:put $ConfigExportName

/export file=$ConfigExportName

:log info ("$ConfigExportName created succesfully!");
Alter it with info from the previous posts and it will save to SD card.

PS.
Adding the compact parameter is not needed anymore since RouterOS 6, it does compact by default.

Re: SD card backup

Posted: Thu Nov 10, 2016 9:46 pm
by ahmedakkaya
You need to share the script required for .RSC?

Re: SD card backup

Posted: Thu Nov 10, 2016 9:48 pm
by Rudios
rsc is the result of export

Re: SD card backup

Posted: Thu Nov 10, 2016 9:51 pm
by ahmedakkaya
How do i take backup of .rsc extension to disk1