aboutsummaryrefslogtreecommitdiff
path: root/operators/timer_unlock.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'operators/timer_unlock.zsh')
-rw-r--r--operators/timer_unlock.zsh14
1 files changed, 14 insertions, 0 deletions
diff --git a/operators/timer_unlock.zsh b/operators/timer_unlock.zsh
new file mode 100644
index 0000000..9736116
--- /dev/null
+++ b/operators/timer_unlock.zsh
@@ -0,0 +1,14 @@
+# Copyright (C) 2024-2026 Maria Lisina
+# Copyright (C) 2024-2026 Danil Lisin
+# SPDX-License-Identifier: Apache-2.0
+
+for dir in $(find "${cache}" "${users}" -follow -name "*.lock")
+do
+ dir_ctime=$(strftime %s)
+ dir_mtime=$(stat +mtime "${dir}")
+
+ if [[ $((dir_ctime - dir_mtime)) -gt 30 ]]
+ then
+ rmdir "${dir}"
+ fi
+done