mirror of
https://github.com/pothi/mikrotik-scripts.git
synced 2025-06-22 14:13:30 +02:00
Add backup scripts
This commit is contained in:
parent
e7f4256e45
commit
1e7b29e615
2 changed files with 38 additions and 0 deletions
19
scripts/backup-cron.rsc
Normal file
19
scripts/backup-cron.rsc
Normal 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
|
19
scripts/backup-scripts.rsc
Normal file
19
scripts/backup-scripts.rsc
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue