Skip to content

Revision cleanup: "auto" thins out in UTC, "1D" in local time, and the docs say neither #4200

Description

@pbleser-oc

The revision cleanup (#1419) measures time in two different time zones, and neither the docs nor the help of the command say which one applies where.

What happens

  • auto thins out in UTC. Its slots of one day or one week are cut from the creation time of a revision with Truncate, i.e. they start at 00:00 UTC (weeks on Mondays, 00:00 UTC). On a server in Germany, a "day" of auto runs from 01:00 to 01:00 in winter and from 02:00 to 02:00 in summer. The verbose output of the command shows this as the oldest in its slot of 1 day starting 2026-11-19T00:00:00Z.
  • 1D and 1W count from local midnight, in the time zone of the process (the server's, or the command's).
  • The command prints times in its local time zone: the times of the revisions and the cutoffs in the reasons (e.g. newer than 2026-11-26T10:28:52+01:00), but the start of a slot of auto in UTC.

Example, with a server in Europe/Berlin and auto: two revisions created on November 19 at 00:30 and at 23:30 local time are in two different slots of auto (November 18 and November 19, in UTC), while a revision of 00:30 and one of 00:59 of November 20 local time are in the same slot as the one of 23:30. Most admins will expect "one per day" to mean their day.

Proposal

  • auto uses the same time zone as 1D: the local time zone of the process. Day and week slots follow the calendar (a day starts at local midnight, also when it has 23 or 25 hours because of daylight saving time; a week starts on Monday at local midnight); shorter slots follow the local wall clock.
  • Whoever wants UTC runs the server and the command with TZ=UTC. Container images without a time zone configured already run in UTC.
  • The docs say explicitly which time zone every time refers to:
    • the strategies (STORAGE_USERS_REVISIONS_CLEANUP_STRATEGY, the README of the storage-users service, the admin docs): auto and 1D/1W use the local time zone of the server, set with TZ or the system's time zone;
    • the help of opencloud storage-users revisions cleanup: the times it prints, and that it should run with the same time zone as the server, otherwise its decisions differ from the server's;
    • the README of the cleanup in reva.

AI assistance: Claude Code (claude-opus-5-5) found this while preparing a demo of the cleanup and drafted this issue; I reviewed it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions