Guest User

Untitled

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