]> git.proxmox.com Git - proxmox-backup.git/commit
tools/logrotate: fix compression logic
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 28 Oct 2020 09:58:00 +0000 (10:58 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 28 Oct 2020 17:50:16 +0000 (18:50 +0100)
commit8b4f4d9ee4be135bfd0c05bddeb72f7b2243d288
treed60c4e95125603992b370117ea01e98aab938ba4
parentb9cc9057612d20c089922213c4fca884c12cd99f
tools/logrotate: fix compression logic

we never actually compressed any files, since we only looked at
the extension:
* if it was 'zst' (which was always true for newly rotated files), we
  would not compress it
* even if it was not 'zst', we compressed it inplace, never adding '.zst'
  (possibly compressing them multiple times as zstd)

now we add new rotated files simply as '.X' and add a 'target' to the
compress fn, where we rename it to (but now we have to unlink the source
path)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/tools/logrotate.rs