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 +