Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # automated backup export ftp
- # ftp configuration
- :local ftphost "123.123.123.123"
- :local ftpuser "ftp"
- :local ftppassword "123"
- :local ftppath "ftp"
- :local CurrentTime [/system clock get time];
- :local CurrentDate [/system clock get date];
- :local Hour [:tostr [:pick $CurrentTime 0 2]];
- :local Min [:tostr [:pick $CurrentTime 3 5]];
- :local Day [:tostr [:pick $CurrentDate 4 6]];
- :local Month [:tostr [:pick $CurrentDate 0 3]];
- :local Year [:tostr [:pick $CurrentDate 7 [:len $CurrentDate]]];
- :local FileName ([/system identity get name]."_$Day-$Month-$Year_$Hour-$Min.backup");
- :log warning "WARNING, now will start backuping. Dude take offline for 3 min";
- :dude set enabled=no;
- :delay 10s;
- #make database export
- :dude export-db backup-file=/disk2/dudedb$FileName;
- :log info "Backup file ($FileName) created success";
- :delay 20s;
- #upload to ftp
- /tool fetch address="$ftphost" src-path=/disk2/dudedb$FileName user="$ftpuser" mode=ftp password="$ftppassword" dst-path="$ftppath/dudedb$FileName" upload=yes
- #Start server
- :dude set enabled=yes;
- :log warning "Backuping is done, dude will started";
Add Comment
Please, Sign In to add comment