Difference between revisions of "NOC:ctwug backup"
From CTWUG Wiki
Bigmikedavis (talk | contribs) (New page: == Purpose == == Dependencies == == Script == == WMS == Wug Management System) |
Bigmikedavis (talk | contribs) |
||
| Line 4: | Line 4: | ||
== Script == | == Script == | ||
| + | :local fid [/system identity get name] | ||
| + | :local fserial [/system routerboard get serial-number] | ||
| + | |||
| + | :if ( [/file find name=ctwug-auto.backup] != "" ) do=[/file remove ctwug-auto.backup] | ||
| + | :delay 1 | ||
| + | /system backup save name=ctwug-auto | ||
| + | :local fwait 1 | ||
| + | :local fcnt 0 | ||
| + | :while ( $fwait = 1 ) do={ | ||
| + | :set fcnt ($fcnt+1) | ||
| + | :log info ("ctwug_backup sleep ".$fcnt) | ||
| + | :delay 1 | ||
| + | if ([/file find name=ctwug-auto.backup] != "") do={ :set fwait 0; } | ||
| + | if ( $fcnt = 20) do={ | ||
| + | :log info "ctwug_backup FAILED"; | ||
| + | :set fwait 0; | ||
| + | }; | ||
| + | }; | ||
| + | :local femail backup@ctwug.za.net | ||
| + | :local fserver 172.18.55.25 | ||
| + | /tool e-mail send server=$fserver from=$femail to=$femail subject="$fid/$fserial" file=ctwug-auto.backup | ||
== WMS == | == WMS == | ||
[[Wug Management System]] | [[Wug Management System]] | ||
Revision as of 21:29, 17 November 2012
Contents
Purpose
Dependencies
Script
:local fid [/system identity get name]
:local fserial [/system routerboard get serial-number]
:if ( [/file find name=ctwug-auto.backup] != "" ) do=[/file remove ctwug-auto.backup]
:delay 1
/system backup save name=ctwug-auto
:local fwait 1
:local fcnt 0
:while ( $fwait = 1 ) do={
:set fcnt ($fcnt+1)
:log info ("ctwug_backup sleep ".$fcnt)
:delay 1
if ([/file find name=ctwug-auto.backup] != "") do={ :set fwait 0; }
if ( $fcnt = 20) do={
:log info "ctwug_backup FAILED";
:set fwait 0;
};
};
:local femail backup@ctwug.za.net
:local fserver 172.18.55.25
/tool e-mail send server=$fserver from=$femail to=$femail subject="$fid/$fserial" file=ctwug-auto.backup