/ tool e-mail
set server=1.2.3.4 from="SomeSystemName@somewhere.tld"
"Generate a Backup" Script
Example 1
/ system script add name="backup_mail" source="/system backup save name=email_backup \n/tool \ e-mail send file=email_backup.backup to=\"someone@somewhere.tld\" body=\"See \ attached file for System Backup\" subject=\(\[/system identity get name\] \ . \" \" . \[/system clock get time\] . \" \" . \[/system clock get date\] \ . \" Backup\"\)\n"
Example 2
:log info "backup beginning now"
:global backupfile ([/system identity get name] . "-" . [/system clock get time])
/system backup save name=$backupfile
:log info "backup pausing for 10s"
:delay 10s
:log info "backup being emailed"
/tool e-mail send to="USERNAME@gmail.com" subject=([/system identity get name] . \
" Backup") from=ROUTER@MAIDOMAIN.com file=$backupfile server=1.3.3.7
:log info "backup finished"
"Weekly Scheduler" Script
Example 1
/ system scheduler add name="sched_backup_mail" on-event="backup_mail" start-date=jan/01/1970 start-time=07:30:00 interval=7d \ 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])}
Tidak ada komentar:
Posting Komentar