-
Notifications
You must be signed in to change notification settings - Fork 26
/
RouterOS_Cloud_Backup.rsc
40 lines (26 loc) · 1.18 KB
/
RouterOS_Cloud_Backup.rsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# RouterOS Function
# Copyright (c) Grzegorz Budny
# Version 1.2
# Last update: 3/15/2020
# Creates new backup file and uploads it to MikroTik Cloud
:global CloudBackup do={
:local systemName [/system identity get value-name=name];
:local backupNumber [/system backup cloud print count-only];
:if ($backupNumber = 0) do={
:log info "...:::No Cloud Backup Present!:::...";
:log info "...:::Cloud backup process started:::...";
/system backup cloud upload-file action=create-and-upload name=$systemName password=$password;
:log info "...:::Cloud Backup Created:::...";
}
:if ($backupNumber > 0) do={
:log warning "...:::Cloud Backup Present!:::...";
:log info "...:::Cloud backup process started:::...";
:log warning "...:::Removing current slot!:::...";
/system backup cloud remove-file 0;
:log warning "...:::Slot removed:::...";
:log info "...:::Cloud backup process started:::...";
/system backup cloud upload-file action=create-and-upload name=$systemName password=$password;
:log info "...:::Cloud Backup Created:::...";
}
}
$CloudBackup password=password