You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Files

File menu shows all userspace files on the router. It is possible to see and edit file content or delete file. file creation is not possible from this menu.  If RouterOS ".npk" package is uploaded, the file menu will also show package specific information, for example architecture, build date and time, etc.

[admin@MikroTik] > file print detail 
 0 name="routeros-mipsbe-6.45.7.npk" type="package" size=11.5MiB creation-time=oct/29/2019 11:36:15 
   package-name="routeros-mipsbe" package-version="6.45.7" package-build-time=oct/24/2019 08:44:35 
   package-architecture="mips" 

 1 name="flash" type="directory" creation-time=jan/01/1970 02:00:03 

 2 name="flash/skins" type="directory" creation-time=jan/01/1970 02:00:04 

 3 name="flash/rw" type="directory" creation-time=sep/06/2019 14:01:16 

 4 name="flash/rw/pckg" type="directory" creation-time=sep/06/2019 14:01:16 

If the device has a directory named "flash" in its file list, then files which you want to be kept after the system reboot/power cycle must be stored within it. As anything outside of it is kept within a RAM disk and will be lost upon reboot. This does not include .npk upgrade files as they will be applied by the upgrade process before the system discards the RAM drive content.

For multicore devices with a NAND flash memory (e.g. CCR series routers, RB4011iGS), RouterOS uses a write-back which will cache file changes into RAM memory instead of writing them straight away into flash media. The file changes will be stored on the flash when it is absolutely necessary, the writing can be delayed by up to 40 seconds. This helps to reduce CPU cycles which results in better performance. However, this can cause empty or zero-length files when a device gets unexpectedly rebooted (e.g. by a power cut) because files were not fully saved on a flash.

Backups

RouterOS backup feature allows you to save the current device's configuration, which then can be re-applied on the same or a different identical model. This is very useful since it allows you to effortlessly restore device's configurations or to re-apply the same configuration on a backup device. The system's backup file also contains the device's MAC addresses, which are also restored when the backup file is loaded. 

If The Dude and user-manager are installed on the router, then the system backup will not contain configuration from these services. Therefore additional care should be taken to save a configuration from these services, for example, configuration export.

System's backups contain sensitive information about your device and its configuration, always consider encrypting the backup file and keeping the backup file in a safe place. 

To save a backup configure the following:

[admin@MikroTik] >  system backup save name=/flash/backup1 password=StrongPass encryption=aes-sha256
Saving system configuration
Configuration backup saved

Note that we use "/flash/ "before the actual backup name on the devices with flash memory. As stated above, backups saved outside the flash folder will be deleted after a reboot or power cycle:

[admin@MikroTik] > system backup save name=backup2 password=StrongPass encryption=aes-sha256         
Saving system configuration
Configuration backup saved
[admin@MikroTik] > file print detail 
 0 name="flash" type="directory" creation-time=jan/01/1970 02:00:03 

 1 name="flash/skins" type="directory" creation-time=jan/01/1970 02:00:04 

 2 name="flash/rw" type="directory" creation-time=sep/06/2019 14:01:16 

 3 name="flash/rw/pckg" type="directory" creation-time=sep/06/2019 14:01:16 

 4 name="backup2.backup" type="backup" size=22.4KiB creation-time=oct/29/2019 11:40:33 

 5 name="flash/backup1.backup" type="backup" size=22.4KiB creation-time=oct/29/2019 11:40:11 

To load a backup, simply configure the following:

[admin@MikroTik] > system backup load name=/flash/backup1 password=StrongPass
Restore and reboot? [y/N]: 
Y
  • No labels