From ef28fb936491af1a7be0c9270aabfb299922df22 Mon Sep 17 00:00:00 2001 From: christian Date: Sat, 17 Apr 2021 22:49:27 +0200 Subject: [PATCH] added systemd files for cleaning directories like /maps folder and cleaning old demos too --- systemd_file_cleaner/clean_file.service | 8 ++++++++ systemd_file_cleaner/clean_file.timer | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 systemd_file_cleaner/clean_file.service create mode 100644 systemd_file_cleaner/clean_file.timer diff --git a/systemd_file_cleaner/clean_file.service b/systemd_file_cleaner/clean_file.service new file mode 100644 index 00000000..67443116 --- /dev/null +++ b/systemd_file_cleaner/clean_file.service @@ -0,0 +1,8 @@ +[Unit] +Description=Deleting files from places after a certain amount of days + +[Service] +Type=simple +User=nonroot +WorkingDirectory="/home/nonroot/.steam/debian-installation/steamapps/common/Counter-Strike Source/cstrike/download/maps" +ExecStart=find "/home/nonroot/.steam/debian-installation/steamapps/common/Counter-Strike Source/cstrike/download/maps" -maxdepth 1 -mtime +2 -type f -delete diff --git a/systemd_file_cleaner/clean_file.timer b/systemd_file_cleaner/clean_file.timer new file mode 100644 index 00000000..034dfe34 --- /dev/null +++ b/systemd_file_cleaner/clean_file.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Runs the fileCleaner once each hour +Requires=clean_file.service + +[Timer] +OnCalendar=*-*-* *:0 + +[Install] +WantedBy=multi-user.target +