Requirements
Dude v6 and above
Note: Please be aware, Dude is stopping during database export/import!
Configuration
1. Create a script.
System --> Scripts:
Name: backup-dude-locally
Policy: ftp, read, write, test
Source:
Code: Select all
#
# Backup Dude locally
#
# Define variables
:local dudeconffilename "Dude_configuration_backup"
:local dudedbfilename "Dude_db_backup"
:local dudeconffileext "rsc"
:local dudedbfileext "db"
:local localbackuppath "disk1"
#
# Get date and time
#
{
:local curDate [/system clock get date]
:local curTime [/system clock get time]
:local systemName [/system identity get name]
:local curMonth [:pick $curDate 0 3]
:set curMonth ( [ :find key="$curMonth" in="jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec" from=-1 ] / 4 + 1)
if ( $curMonth < 10 ) do={
:set curMonth ( "0".$curMonth )
} else={
:set curMonth $curMonth
}
:local curDay [:pick $curDate 4 6]
:local curYear [:pick $curDate 7 13]
:local curHour [:pick $curTime 0 2]
:local curMin [:pick $curTime 3 5]
:local now ("$curYear"."$curMonth"."$curDay" ."-"."$curHour"."$curMin")
#
# 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";
#
}
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 3. See the result
Files
Restore backup
In case of need, you can restore Dude v6 from recently created backup:
Code: Select all
/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
Used materials
1. Export to File - Filename Variable
2. Manual:The Dude v6/DB import export
Related solutions
1. Dude v6 - Backup to FTP