From 7e3c0211994d2cf894fc557d740b94c40fe19d84 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 9 Jul 2021 12:39:27 +0200 Subject: [PATCH] add systemd timer to clean up old Downloads and old temp dirs --- .config/systemd/user/cleanup-homedir.service | 7 +++++++ .config/systemd/user/cleanup-homedir.timer | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 .config/systemd/user/cleanup-homedir.service create mode 100644 .config/systemd/user/cleanup-homedir.timer diff --git a/.config/systemd/user/cleanup-homedir.service b/.config/systemd/user/cleanup-homedir.service new file mode 100644 index 0000000..3eba45e --- /dev/null +++ b/.config/systemd/user/cleanup-homedir.service @@ -0,0 +1,7 @@ +[Unit] +Description=Clean Up Homedir + +[Service] +ExecStart=/usr/bin/find /home/kunsi/Downloads/ -mtime +30 -delete +ExecStart=/usr/bin/find /home/kunsi -maxdepth 1 -type d -iname 'tmp.*' -mtime +30 -exec rm -r {} \; +Type=oneshot diff --git a/.config/systemd/user/cleanup-homedir.timer b/.config/systemd/user/cleanup-homedir.timer new file mode 100644 index 0000000..8e0dcac --- /dev/null +++ b/.config/systemd/user/cleanup-homedir.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run cleanup-downloads + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target