Script that performs a backup of the router configuration automatically and that we can define how often it is repeated, on a Linux server, and sends us a notification by telegram with the result.
Requirements:
- EdgeRouter 4 Router, valid for 6P (tested with firmware: v2.0.9-hotfix.7)
- Linux server
- Telegram account
ssh {user}@{ip_router}
sudo bash
ssh-keygen -t rsa -b 4096
...
ssh-copy-id -i .ssh/id_rsa.pub {user}@{ip_server}
TOKEN={YOUR_TOKEN_TELEGRAM}
CHAT_ID={YOUR_CHAT_ID}
server_user={USER_SERVER}
server_backup={IP_SERVER}
/config/ssh-keys/telegram.env
/config/scripts/backup-config.sh
chmod a+x /config/scripts/backup-config.sh
configure
set system task-scheduler task backup-conf executable path /config/scripts/backup-config.sh
set system task-scheduler task backup-conf interval {interval}
commit ;save
{interval}
- none - Execution interval in minutes
- m - Execution interval in minutes
- h - Execution interval in hours
- d - Execution interval in days
example:
set system task-scheduler task backup-conf interval 7d