# Get system identity and date :local sysname [/system identity get name]; :local datetime [/system clock get date]; # Format date to remove slashes (e.g., jan/01/2026 to jan012026) :local datestr ""; :for i from=0 to=([:len $datetime] - 1) do= :local char [:part $datetime $i ($i+1)]; :if ($char != "/") do= :set datestr ($datestr . $char) ; :local backupName ($sysname . "_" . $datestr); # Create Binary Backup with Encryption /system backup save name=$backupName password="YourBackupPassword123"; # Create Script Export with Sensitive Data /export file=$backupName show-sensitive; :log info "System backup and export completed successfully for $sysname"; Use code with caution. Scheduling the Script
For network administrators responsible for tens or hundreds of routers, installing individual scripts is a management nightmare. The solution is a centralized automation tool like : mikrotik backup restore better
/system scheduler add name="Daily_Backup" start-time=02:00:00 interval=1d on-event="Name_Of_Your_Backup_Script" Use code with caution. 5. Advanced Infrastructure: Centralized Backup Tools # Get system identity and date :local sysname
# Backup /system backup save name=full.backup /export file=full.rsc show-sensitive $datestr); # Create Binary Backup with Encryption /system
Before creating backups, you must understand the difference between the two methods available in RouterOS.
©2024. Theporndata. All Rights Reserved. |