Closed Bakuriu closed 1 year ago
I admit that I underestimated the need for custom file date suffix from the beginning. Currently, I am even using both the BACKUP_FILE_DATE
and BACKUP_FILE_DATE_SUFFIX
environment variables to create the file date suffix.
However, to avoid any break changes, I will add a new environment variable called BACKUP_FILE_SUFFIX
, which will have a higher priority and will be used to identify the part between the file name and the extension. The implementation will be [filename].$(date +"${BACKUP_FILE_SUFFIX}").[ext]
. Of course, BACKUP_FILE_SUFFIX
will not restrict any input characters, but users need to be careful when modifying this environment variable to avoid the risk of continuous overwriting of backup files.
I am currently working on adding this feature and will notify you once I release the new version.
@Bakuriu
Released in v1.18.0.
Something that has been bugging me for some time is that I'd like to use
%Y-%m-%dT%H:%M
as format for the date for my files, but this tool silently discards the:
so instead of writing18:17
it writes1817
.I have read the documentation here: https://github.com/ttionya/vaultwarden-backup#backup_file_date_suffix However I believe that it is wrong. It claims this:
But this is clearly wrong!
For once, in the 20+ years I've been using linux
date
has always worked with, say,%H:%M
. Secondly looking at the official GNU documentation fordate
invocation you see a clear example containing:
!In fact I'm pretty sure that
date
is quite forgiving in what it accepts.Can we please allow at least
:
which is a super common separator for time? Also: instead of silently dropping stuff I suggest you throw an error. At least people know that you are restricting the input. Silently modifying the template can yield unexpected results.