diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-bt-cache.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-bt-cache.service new file mode 100644 index 000000000..c59cbdb11 --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-bt-cache.service @@ -0,0 +1,15 @@ +[Unit] +Description=Remove Bluetooth cache entries older than one week + +[Service] +Type=oneshot +ExecStart=/bin/sh -c 'find /var/lib/bluetooth/*/cache -mindepth 1 -type f -atime +7 -exec rm {} \;' +PrivateDevices=yes +PrivateNetwork=yes +PrivateUsers=no +ProtectKernelTunables=yes +ProtectKernelModules=yes +ProtectControlGroups=yes +MemoryDenyWriteExecute=yes +SystemCallFilter=@default @file-system @basic-io @system-service + diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-bt-cache.timer b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-bt-cache.timer new file mode 100644 index 000000000..829c5e5d3 --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/haos-bt-cache.timer @@ -0,0 +1,13 @@ +[Unit] +Description=Remove Bluetooth cache entries +ConditionPathExistsGlob=/var/lib/bluetooth/*/cache + +[Timer] +OnCalendar=weekly +AccuracySec=1h +Persistent=true +RandomizedDelaySec=6000 + +[Install] +WantedBy=timers.target +