This article is just a script that you can cut and paste (with small changes) to your router. It will set up the necessary stuff to automate backups. The script is commented well and the parts that you need to customize are highlighted, so that you know what has to be adjusted. This is based on a script posted on Mikrotik’s website, updated to work in 2.9.x and 3.x.

# Set the NTP servers below.

/ system ntp client
set enabled=yes mode=unicast primary-ntp=24.79.76.105 \
secondary-ntp=24.123.66.139

# This will create a text backup of your system and email it to an email
# address of your choice. The easiest way to insure you get this right
# is to cut/paste this text into notepad, then search and replace the
# following text with appropriate values.
# you@yourdomain.com - replace with your email address
# X.X.X.X - replace with your mailservers IP ADDRESS (not dns name)
#
# VERY IMPORTANT - this script will not run correctly if the system name
# is set with a space in it. You can fix this by going to SYSTEM->IDENTITY
# in Winbox.

/ system script
add name="makebackup" source=":log info "Starting Backup Script"\n \
/export file=[/system identity get name]\n \
:delay 20\n /tool e-mail send to=you@yourdomain.com \
subject=([/system identity get name] . " \
Backup") from=you@yourdomain.com \
file=([/system identity get name] . ".rsc") \
server=X.X.X.X \n:log info "Finished Backup Script"" \
policy=ftp,reboot,read,write,policy,test

# Set the interval here to schedule the above backup script every
# day/week/month (or hour if you want). Don't mess with the start
# date or start time unless you have a good reason to do so

/ system scheduler
add name="email-backup" on-event=makebackup \
start-date=mar/03/2006 start-time=02:15:00 \
interval=7d comment="Weekly Backups" disabled=no The above script can be tested in Winbox by clicking: SYSTEM->SCRIPT, then highlight the makebackup entry and click RUN. You will see entries in the log (click LOG to view these) to indicate the script starting and stopping. When it completes, check your email to insure you get the email with the backup attached.
I hope this article has been helpful for you.




موضوعات مشابه: