Dude-v6-Backup-locally-01-Script.png
2. Create a schedule.
System → Scheduler:
Name: backup-dude-locally
Start Day: Nov/07/2017
Start Time: 02:00:00
Interval: 1d 00:00:00
Policy: ftp, read, write, test
On Event: dude-backup-locally
Dude-v6-Backup-locally-02-Schedule.png
3. See the result
Files
Dude-v6-Backup-locally-03-Files.png
Restore backup
In case of need, you can restore Dude v6 from recently created backup:
/dude set enabled=no
/import disk1/Dude_configuration_backup_20170716-0200.rsc
/dude import-db backup-file=disk1/Dude_db_backup_20170716-0200.db
/dude set enabled=yes
On my RB with v7 date has following format:
[admin@R0B] > /system/clock/print
time: 19:07:22
date: 2024-11-02
time-zone-autodetect: yes
time-zone-name: Europe/Riga
gmt-offset: +02:00
dst-active: no
So, backup filename looks not correct. Can anybody adapt original script to 2024-11-02 format?
Here is quick hack to adapt the script for newer date format using in V7. I cannot vouch for the restore part, but this should work to keep same format as previous version. Basically the “Get date and time” part is replaced from above:
{
### Backup Dude locally ###
# Set root path for backup
:local localbackuppath "disk1"
# Define variables to use for file generation
:local dudeconffilename "Dude_configuration_backup"
:local dudedbfilename "Dude_db_backup"
:local dudeconffileext "rsc"
:local dudedbfileext "db"
# Get date and time
:local getnow do={
:local d [/system/clock/get date];
:local t [/system/clock/get time];
:return "$[:pick $d 0 4]$[:pick $d 5 7]$[:pick $d 8 10]-$[:pick $t 0 2]$[:pick $t 3 5]"
}
:local now [$getnow]
# Make Dude backup
:log warn message="Dude backup locally started";
/dude export file="$localbackuppath/$dudeconffilename_$now.$dudeconffileext"
/dude export-db backup-file="$localbackuppath/$dudedbfilename_$now.$dudedbfileext"
:log warn message="Dude backup locally finished"
}