Mikrotik Backup File

Home

Mikrotik Backup File

Hello all, This is what I have setup so far. I have all of my mikrotik routers set to make a backup at 7pm through the scheduler. I have a device going out to the routers through FTP to get the backup at 12pm and saving it another location.

Download Kannathil Muthamittal songs, Download Kannathil Muthamittal Songs Tamil, Kannathil Muthamittal mp3 free download, Kannathil Muthamittal songs, Kannathil Muthamittal songs download, Tamil Songs. TamilWire; Tamil Radios; Contact us; Home > K - O > Kannathil Muthamittal. Kannathil Muthamittal Songs Download Kannathil Muthamittal Mp3 Songs Download Kannathil Muthamittal Movie Mp3 Songs Free Download. Isaimini.Co Name Of Quality. Like our Facebook Fan Page & Get Updates and News! Kannathil Muthamittal. Download Kannathil Muthamittal songs,Kannathil Muthamittal mp3 songs free download,Download Kannathil Muthamittal Tamil in zip/rar format at. Kannathil muthamittal mp3 download free.

That's all setup and working. Here is the script to setup the scheduler.

/system scheduler add name=Backup start-date=Sep/02/2011 start-time=19:00:00 interval=1d on-event='/system backup save' The only thing I can't seem to get working is the script I wrote to remove the MikroTik backup after it's been saved to a different location. This is one of my many attempts to get it to remove the backup. /system scheduler add name='Remove backup' start-date=Sep/02/2011 start-time= 018:45:00 interval=1d on-event='/file remove 0 r n/ file remove 1' If I go to the terminal and type in /file remove 0 it works fine, but not through a script. I do things opposite of you.

While searching the web I have found this cool blog containing Mikrotik Automated Backup script. Thanks for the nice script Harry B! With some small modifications this script works perfectly doing two files export and backup of the whole configuration: Just Copy and Paste the script in System -> Scripts.

Backup

I fetch backups from all MT routers on the network at a specific time each night (I don't push them). I use ssh/scp with key based authentication: On the machine that keeps the backup, I copy the public SSH RSA/DSA key to the MT: scp /home/mtbackup/.ssh/id_dsa.pub admin@mtrouterip:/id_dsa.pub Then, create a user on the MT (this example uses 'mtbackup').

Then, I import the public key on the MT: /user ssh-keys import public-key-file=id_dsa.pub user=mtbackup This allows your backup box to login to the MT without a password and execute a config dump, and then copy the file to your backup server. Here is a script that I wrote to do this (create a file named 'mtlist' and list your router IP's/hostnames in this file): #!/bin/bash # mtbackup.sh # Created by jb () # # This script uses key based SSH to login to MT devices, listed in mtlist # creates a text file configuration backup, and then downloads the configs # via SSH (scp) to this host where they are archived for 'X' number of days. # Set this to the text file that contains a list of your MT devices, # one per line. MTLIST=/home/mtbackup/scripts/mtlist # Store backup information in what directory? MTBACKUPDIR=/home/mtbackup # Specify remote MT user to use MTBACKUPUSER=mtbackup for device in `cat $MTLIST` do # Create subdirectory for device if needed if [! -d '$MTBACKUPDIR/$device' ]; then # Create the directory first mkdir $MTBACKUPDIR/$device fi # Execute backup via SSH backupfile=$device.`date +%Y%m%d` ssh $MTBACKUPUSER@$device export file=$backupfile # Fetch the backup file sleep 5 scp $MTBACKUPUSER@$device:/$backupfile.rsc $MTBACKUPDIR/$device/ # Delete the backup file from the MT sleep 5 ssh $MTBACKUPUSER@$device rm $backupfile.rsc done Just an alternative option. I prefer to pull configs instead of push.

This is what we do: # Create backup, overwrite existing backup /system backup save name=([/system identity get name]); # # Email backup to your phone, or whatever. /tool e-mail send to='you@yourdomain.com' subject=([/system identity get name].

' Backup') file=([/system identity get name]. '.backup') # # Create export, overwrite existing export. /export file ([/system identity get name]); # # Email export to your phone or whatever. /tool e-mail send to='you@yourdomain.com' subject=([/system identity get name].

' Export') file=([/system identity get name]. '.rsc') # You don't have to do both. It overwrites the existing backup and rsc files and emails copies wherever you want them. I wish I could tell you I wrote this one but a consultant we hired wrote it and if he wishes to be credited I will happily do that. Very simple, hang it on a schedule and forget it. Mind you, you will have to configure your Mikrotik to use your email server but that is a different discussion.

Export fails because the 'date' part contains / ('dec/06/2017'), which I think is not allowed in file names. You have to extract day and month with the:pick command.:local name [/system identity get name];:local date [/system clock get date];:local day [:pick $date 4 6 ]:local month [:pick $date 0 3 ]:local backupName ($name.' _log');:put $backupName /system backup save name=$backupName And by the way I would not use the 'backup' command, rather use the 'export' command which is more portable (but doesn't save certificates and passwords). Script backup: ps: Email settings ok 1) Create in System>Scripts Name: backup-script:log info 'Mikrotik Backup JOB Started.. Admin':global backupfile configbackup:log info 'Deleting old Backup File If available otherwise ignore & process further.. ' /system backup save name=$backupfile:log info 'Backup process pausing for 10s so it complete creating backup file':delay 10s:log info 'Start Sending Backup File via Email using GMAIL SMTP..'