From c8d0f735ebe28a4b0cfa1835cfd4e5690c350376 Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Wed, 20 Jul 2016 19:19:16 +0200 Subject: [PATCH] Simplify cleaning of temporary files. --- systemd/.config/systemd/user/tmpfiles-cleanup.service | 9 +++++++++ systemd/.config/systemd/user/xdg-cache-clean.service | 7 ------- systemd/.config/systemd/user/xdg-cache-clean.timer | 9 --------- systemd/.config/tmpfiles/tmpfiles.conf | 3 +++ 4 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 systemd/.config/systemd/user/tmpfiles-cleanup.service delete mode 100644 systemd/.config/systemd/user/xdg-cache-clean.service delete mode 100644 systemd/.config/systemd/user/xdg-cache-clean.timer create mode 100644 systemd/.config/tmpfiles/tmpfiles.conf diff --git a/systemd/.config/systemd/user/tmpfiles-cleanup.service b/systemd/.config/systemd/user/tmpfiles-cleanup.service new file mode 100644 index 0000000..90add2b --- /dev/null +++ b/systemd/.config/systemd/user/tmpfiles-cleanup.service @@ -0,0 +1,9 @@ +[Unit] +Description=Cleanup of the XDG_CACHE_HOME directory + +[Service] +Type=oneshot +ExecStart=/usr/bin/systemd-tmpfiles --root=%h --clean %h/.config/tmpfiles/tmpfiles.conf + +[Install] +WantedBy=default.target diff --git a/systemd/.config/systemd/user/xdg-cache-clean.service b/systemd/.config/systemd/user/xdg-cache-clean.service deleted file mode 100644 index 1acc792..0000000 --- a/systemd/.config/systemd/user/xdg-cache-clean.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Cleanup of the XDG_CACHE_HOME directory - -[Service] -Environment="XDG_CACHE_HOME=%h/.cache" -Type=oneshot -ExecStart=/usr/bin/find $XDG_CACHE_HOME -atime +60 -delete -print diff --git a/systemd/.config/systemd/user/xdg-cache-clean.timer b/systemd/.config/systemd/user/xdg-cache-clean.timer deleted file mode 100644 index 0ce80ad..0000000 --- a/systemd/.config/systemd/user/xdg-cache-clean.timer +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Weekly cache dir cleanup - -[Timer] -OnCalendar=weekly -Persistent=true - -[Install] -WantedBy=default.target diff --git a/systemd/.config/tmpfiles/tmpfiles.conf b/systemd/.config/tmpfiles/tmpfiles.conf new file mode 100644 index 0000000..247111f --- /dev/null +++ b/systemd/.config/tmpfiles/tmpfiles.conf @@ -0,0 +1,3 @@ +#Type Path Mode UID GID Age Argument + e /.cache - - - 60d - + e /Downloads - - - 7d -