Add backup scripts

This commit is contained in:
Pothi Kalimuthu 2022-02-20 09:29:29 +05:30
parent e7f4256e45
commit 1e7b29e615
2 changed files with 38 additions and 0 deletions

19
scripts/backup-cron.rsc Normal file
View file

@ -0,0 +1,19 @@
# Backup cron (schedules).
# requirements:
# policy: ftp, read, write, policy, test
:local adminEmailAddress pothi@duck.com
:local deviceIdentity [/system identity get name]
:log info "Executing the script \"backup-cron\"..."
/system scheduler export file=cron; :delay 3s
/tool e-mail send to="$adminEmailAddress" \
subject="[Mikrotik $deviceIdentity] Backup of Cron Entries" \
body="See subject and attachment" \
file=cron.rsc; :delay 10s
:log info "An email is probably sent to $adminEmailAddress."
/file remove cron.rsc

View file

@ -0,0 +1,19 @@
# Backup scripts.
# requirements:
# policy: ftp, read, write, policy, test
: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" \
body="See subject and attachment" \
file=scripts.rsc; :delay 10s
:log info "An email is probably sent to $adminEmailAddress."
/file remove scripts.rsc