simple mikrotik backup sh

Hi there,

here some nice script to backup your RouterOS config
using ssh keys

simply generate an ssh key

ssh-keygen -t dsa

copy your public key via ftp to your router and import it

#!/bin/bash

date=$(date +%F)
router="10.0.0.1"
idfile="/user/.ssh/id_dsa"
backuppath="/path/to/backups"
option="StrictHostKeyChecking=no"

ssh -l admin $router -i $idfile -o $option "export" > $backuppath/$router-backup-$date.txt

find $backuppath -type f -mtime +14 -exec rm {} ;

Have fun!