New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for %z (offset from UTC) in dateformat #584
Comments
cgzones
added a commit
to cgzones/logrotate
that referenced
this issue
Mar 15, 2024
Add support for the strftime(3) specifier %z to handle timezone offsets. Closes: logrotate#584
Please give #594 a try. |
Seems to work:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm proposing adding support for
%z
(offset from UTC) indateformat
.From https://man7.org/linux/man-pages/man3/strftime.3.html:
Use case is hourly log rotation configurations where using local timestamps are desired. Without the UTC offset there will be duplicate file names when DST ends.
Without
%z
the only logrotate-only workaround I know to get unique hour-based file names is adding the unix timestamp with%s
, but it provides confusingly long string of numbers.(My current workaround is using a fixed string "-rotated" for dateformat and using a
lastaction
to run a Python script that renames the files to the desired syntax.)The text was updated successfully, but these errors were encountered: