From 0ece6b3294dff1eb484ce4c833fafcc791064894 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Tue, 20 Aug 2019 11:07:18 +0200 Subject: [PATCH] CHanged crontab. Added garbage collector which moves unused images into trash folder. --- README.md | 5 +++-- bin/timelapse_garbage_collector.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 37e1533..57f0d56 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ Crontab: +``` # # Timelapse # @@ -8,5 +9,5 @@ Crontab: 0 2 * * * rm /mnt/extern/timelapse/daily/*; ${HOME}/timelapse/bin/timelapse_daily.sh && ${HOME}/timelapse/bin/timelapse_video.sh daily 0 3 * * 1 rm /mnt/extern/timelapse/weekly/*; ${HOME}/timelapse/bin/timelapse_weekly.sh && ${HOME}/timelapse/bin/timelapse_video.sh weekly 0 3 1 * * rm /mnt/extern/timelapse/monthly/*; ${HOME}/timelapse/bin/timelapse_monthly.sh && ${HOME}/timelapse/bin/timelapse_video.sh monthly; rm /mnt/extern/timelapse/yearly/*; ${HOME}/timelapse/bin/timelapse_yearly.sh && ${HOME}/timelapse/bin/timelapse_video.sh yearly -#0 4 15 * * ${HOME}/timelapse/bin/timelapse_garbage_collector.sh - +0 9 * * 1 [[ "$(/bin/date +\%d)" -le 7 ]] && ${HOME}/timelapse/bin/timelapse_garbage_collector.sh # runs only the first monday a month +``` diff --git a/bin/timelapse_garbage_collector.sh b/bin/timelapse_garbage_collector.sh index cce3a6d..8e9715a 100755 --- a/bin/timelapse_garbage_collector.sh +++ b/bin/timelapse_garbage_collector.sh @@ -11,6 +11,6 @@ do NUM_HARDLINKS=`stat --format="%h" ${i}` if [ ${NUM_HARDLINKS} -lt 2 ] then - echo "${i} : ${NUM_HARDLINKS}" + mv "${i}" "${DATA}/trash" fi done