/file remove [find where name~"auto_backup" and type="backup" and creation-time<([/system clock get date] - 30d)] /file remove [find where name~"auto_backup" and type="script" and creation-time<([/system clock get date] - 30d)]
:log info "Backup suite completed for $backupName" mikrotik backup restore better
Why this is better: You now have a binary file for a direct restore and a text file you can grep for an IP address or firewall rule. You have off-site storage and automatic garbage collection. Why this is better: You now have a
Do not rely on just the .backup file. Always generate both. Do not rely on just the
MikroTik RouterOS provides three main ways to save and restore configuration:
| Backup Type | Command / Method | Contents | Best for |
|-------------|----------------|----------|----------|
| Binary Backup | /system backup save | Entire router config in binary (encrypted, includes MAC addresses, private keys) | Full disaster recovery on same hardware/model |
| Export | /export or /export compact | Human-readable script (commands) | Migrating to different hardware, version upgrades, documentation |
| Cloud Backup | /system backup cloud | Binary backup stored on MikroTik cloud | Offsite backup, easy restore via same RouterOS account |
⚠️ Binary backups are NOT portable across different RouterOS versions or hardware platforms. Exports are portable but may need tweaks.
/import file=config.rsc