Send Backup email
This means that the article should be updated to the latest information available,
it's formatting improved, and irrelevant information removed. Anyone can help improving our wiki, please contribute!
See Wikipedia:How to edit a page and for help, or this article's talk page.
Example 1
add name="backup_mail" source="system backup save name=email \n/tool e-mail send \ to=\"me@mydomaint.abc\" from=\"someone@somewhere.abc\" server=\"213.157.170.43\" subject=\(\[/system \ identity get name\] . \" \" . \[/system clock get time\] . \" \" . \[/system clock get date\] . \" \ Backup\"\) file=email.backup" policy=ftp,reboot,read,write,policy,test
These scripts are of course used with schedulers, example:
/ system scheduler add name="sched_start_dc1" on-event=start_dc1 start-date=sep/21/2005 start-time=23:00:00 interval=1d \ comment="" disabled=no add name="sched_backup_mail" on-event=backup_mail start-date=sep/23/2005 start-time=07:30:00 interval=7d \ comment="" disabled=no add name="sched_stop_dc1" on-event=stop_dc1 start-date=sep/22/2005 start-time=07:00:00 interval=1d comment="" \ disabled=no
Example 2
/system script add name=ebackup source={/system backup save name=([/system identity get name] . "-" . \
[:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . [:pick [/system clock get date] 4 6]); \
/tool e-mail send to="youremail@yourdomain.com" subject=([/system identity get name] . " Backup " . \
[/system clock get date]) file=([/system identity get name] . "-" . [:pick [/system clock get date] 7 11] . \
[:pick [/system clock get date] 0 3] . [:pick [/system clock get date] 4 6] . ".backup"); :delay 10; \
/file rem [/file find name=([/system identity get name] . "-" . [:pick [/system clock get date] 7 11] . \
[:pick [/system clock get date] 0 3] . [:pick [/system clock get date] 4 6] . ".backup")]; \
:log info ("System Backup emailed at " . [/sys cl get time] . " " . [/sys cl get date])}
The above example shows a series of commands executed via a scheduler entry, which can help you manage multiple backups from multiple routers more easily. Here is what it does:
1) It makes a backup named as the routers system identity plus the date and time.
2) It emails you the backup it just created (assuming you have already set your email server address under "/tool e-mail")
3) It waits 10 seconds for the router to complete the email task, and then deletes the backup you made (to conserve space on the router).
4) It inserts an entry in the system log telling you that it ran.