From 80823c290135292cd4b79cb45cc1dcbcfb479b65 Mon Sep 17 00:00:00 2001 From: christian Date: Fri, 18 Jun 2021 16:23:27 +0200 Subject: [PATCH] added example of service and timer file that each hour checks if a map file is 3 hours old and then deletes it --- AutismBotIngame/service_files/clean_maps1.service | 7 +++++++ AutismBotIngame/service_files/clean_maps1.timer | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 AutismBotIngame/service_files/clean_maps1.service create mode 100644 AutismBotIngame/service_files/clean_maps1.timer diff --git a/AutismBotIngame/service_files/clean_maps1.service b/AutismBotIngame/service_files/clean_maps1.service new file mode 100644 index 00000000..4f886c56 --- /dev/null +++ b/AutismBotIngame/service_files/clean_maps1.service @@ -0,0 +1,7 @@ +[Unit] +Description=Deleting files from places after a certain amount of days + +[Service] +Type=simple +User=autismbot1 +ExecStart=find "/home/autismbot1/.steam/debian-installation/steamapps/common/Counter-Strike Source/cstrike/download/maps" -maxdepth 1 -mmin +179 -type f -delete diff --git a/AutismBotIngame/service_files/clean_maps1.timer b/AutismBotIngame/service_files/clean_maps1.timer new file mode 100644 index 00000000..ad00ba55 --- /dev/null +++ b/AutismBotIngame/service_files/clean_maps1.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs the maps Cleaner once each 10 hours +Requires=clean_maps1.service + +[Timer] +OnCalendar=00/1:00 + +[Install] +WantedBy=multi-user.target