2022-02-20 09:29:29 +05:30
|
|
|
# Backup scripts.
|
|
|
|
|
2022-02-20 10:47:51 +05:30
|
|
|
# filename: backup-scripts
|
2022-02-20 09:29:29 +05:30
|
|
|
# policy: ftp, read, write, policy, test
|
2022-02-20 10:47:51 +05:30
|
|
|
|
2022-02-20 09:29:29 +05:30
|
|
|
:local adminEmailAddress "admin@example.com"
|
|
|
|
:local deviceIdentity [/system identity get name]
|
|
|
|
|
|
|
|
:log info "Executing the script \"backup-scripts\"..."
|
|
|
|
|
|
|
|
/system script export file=scripts; :delay 3s
|
|
|
|
|
|
|
|
/tool e-mail send to="$adminEmailAddress" \
|
|
|
|
subject="[Mikrotik $deviceIdentity] Backup of Scripts" \
|
2022-02-20 10:47:51 +05:30
|
|
|
body="See the subject and the attachment." \
|
2022-02-20 09:29:29 +05:30
|
|
|
file=scripts.rsc; :delay 10s
|
|
|
|
|
|
|
|
:log info "An email is probably sent to $adminEmailAddress."
|
|
|
|
|
|
|
|
/file remove scripts.rsc
|