pitrery icon indicating copy to clipboard operation
pitrery copied to clipboard

be more strict about what we consider a valid backup directory

Open blogh opened this issue 4 years ago • 4 comments

hi,

Since we create backup directory with the format : YYYY.MM.DD_HH.MM.SS We should filter valid backup directories with the same criteria instead of [0-9]*

A second criteria should be the presence of a backup_timestamp file.

toughts ?

Benoit

Edit: HH_MM_SS => HH.MM.SS

blogh avatar Jun 22 '20 09:06 blogh

Salut Benoit,

I agree to be more strict with backup names.

Be careful that backup_name depends on $USE_ISO8601_TIMESTAMPS.

Thus, backup_name could be of the form:

$ stop_time="2020-06-07 02:06:04 CEST"
$ date -d "$stop_time" +"%FT%T%z"
2020-06-07T02:06:04+0200
$ echo $stop_time | awk '{ gsub(/[:-]/, "."); print $1"_"$2 }'
2020.06.07_02.06.04

It seems to me that purge might not work with USE_ISO8601_TIMESTAMPS activated??

madtibo avatar Jun 23 '20 08:06 madtibo

Good catch, I completely missed the timezone thing.

blogh avatar Jun 23 '20 10:06 blogh

Ah, no, we just filter by directory starting with digits.

No problem to create some stricter regex

madtibo avatar Jun 23 '20 11:06 madtibo

I will try to work on this next week then.

blogh avatar Jun 24 '20 15:06 blogh