Clean up stale temporary files in data/tmp and font-lib system tmp files

XMLWordPrintable

    • High
    • None
    • Stale temporary files in translate5's tmp directory and leftover font processing files are cleaned up automatically once per day.
    • None

      problem

      Temporary files below APPLICATION_DATA/tmp are created by several translate5 features, but there is no generic daily cleanup for stale leftovers in that directory. Existing cleanup jobs only cover specific domains, for example queued exports or date-based integration folders.

      Additionally, VisualReview font processing can leave fnt* files below PHP's system temp directory. Those files originate in the third-party phenx/php-font-lib WOFF handling, which creates temp files with sys_get_temp_dir() and does not expose the generated filename to translate5 for cleanup. See https://github.com/dompdf/php-font-lib/issues/159.

      solution

      Extend the existing daily cleanup flow with two targeted cleanup steps:

      • Add a safe timestamp-based cleanup for "APPLICATION_DATA/tmp" and/or runtimeOptions.dir.tmp. It must only delete stale files and empty directories older than a conservative threshold, and it must protect known long-lived runtime entries such as worker sockets/FIFOs or other explicitly excluded files (worker.fifo).
      • Add a daily timestamp-based cleanup for fnt* files below sys_get_temp_dir(), limited to stale files only, as workaround for the php-font-lib cleanup issue referenced above.

      The implementation should reuse the existing cleanup infrastructure where appropriate, keep the cleanup daily only, and add focused tests for the deletion threshold and exclusion behaviour.

            Assignee:
            Leon Kiz
            Reporter:
            Thomas Lauria
            None
            None
            Thomas Lauria
            Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None