Files
docker-zulip/entrypoint.sh
AUX 24678b6e5b Use ISO 8601 date format for backup filenames
With previous `%D` format preventable errors like

```
tar (child): /data/backups/backup-09/05/22-03-22-03.tar.gz: Cannot open: No such file or directory
```

will occur. Let's use a more sane[^1] date format where possible.

The -I flag to date(1) was added in roughly 1999[^2] and is portable across
GNU coreutils and BusyBox. Piping to tr(1) to remove colons in filenames
is largely a Windows-compatibility concern, as Win32 does not allow for
that character in filenames[^3], and it's possible that the backups target
directory could be a volume mount to a Windows host (for example on
Docker Desktop For Windows).

[^1]: https://xkcd.com/1179/
[^2]: https://unix.stackexchange.com/a/164834
[^3]: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions

Co-Authored-By: Josh Klar <josh@zulip.com>
2022-11-28 15:09:15 -05:00

21 KiB
Executable File