Closed MaxBQb closed 3 years ago
%restore as alias to %backup restore
Also %backup size [max_size in MB]
%backup size => current size limitation
%backup size 10 => only 10 MB allowed
If size not set, it's equals to amount of free space available
Config option to select path to backups (Never allow someone to explore your filesystem) Maybe, size/count limitations also should be set via config? To avoid spaming backups leading to leack of free space Also maybe there should be some limitations in frequency of force backuping, to protect server disk from mass-overwrite
@MaxBQb I think it would be useful to let members decide what type of compression to use for archiving zip-file, like: store
, deflated
, bzip2
, lzma
.
And add subcommand %backup compression [algorithm]
or %backup comp [algorithm]
What do you think?
%backup period <minutes>
About this, I know good parser that can parse to datetime object. Maybe you don't have to limit this command only to minutes?
Maybe, size/count limitations also should be set via config?
In config will be name of default folder
that will store all backups and size limit
and backups max limit
for each server
For this name of default folder
, it will be folder in server root dir
For now I think of 3 settings for backups in config, but you can suggest another settings :)
About compression: When you don't know what kind of file you'll compress then it is a good idea to allow PRO users to choose most comprehensive algorithm (IMHO, auto detection is the better option), BUT: you DO know the types of files... because you create backups of server world, which always have same inner structure, so I think, that you should compare all this methods and just choose proper algorithm by your own. Anyway if you can't simply choose one, then you should add description for each method, to let user know, how to choose one, in terms of fast compression and smaller size.
You can use parser to get the time, also check how discord.py handles datetime/timedelta by it's own, and never forget to use parses in command type hints (it's better then stupid str everywhere) Also give me a link to this parser, I'll want to use it later :)
About compression:
I think yes, I'll just write all the pros and cons of the algorithms/methods, users will choose a maximum of one or two times.
About parser: https://github.com/scrapinghub/dateparser. The result is datetime object, though. But it's interesting to experiment with it. :)
Usage: (datetime.datetime.now() - dateparser.parse("5 hours")).seconds + 1
equals 18000
%backup size => current size limitation %backup size 10 => only 10 MB allowed
Maybe it's not good to let server members change this value?
Maybe
Also maybe there should be some limitations in frequency of force backuping, to protect server disk from mass-overwrite
How much seconds must be between intervals? 1 minute? 10 minutes?
Less than minute
Added this feature in new release
%backup on | off | force | info | count | restore | period
info is default%backup on | off
Toggles autobackup%backup period <minutes>
Set periof of automatic backups%backup force <reason>
Make backup of currently selected world%backup count [count]
If no count presented prints current maximum count of backups for selected world else max count set to this number support infinity value%backup restore <date time>
Restore current world with selected backup%backup info [all]
by default Show current auto-backup state Max backup count and latest backup infooutput:
Example (auto)
Example (caused by user)
%backup info all
Prints info about all backups available:Separate servers have separate backup