From ee622fe87594ab59b7c3c97ea79dac5e1067767c Mon Sep 17 00:00:00 2001 From: James Kinsman <1069212+VibroAxe@users.noreply.github.com> Date: Thu, 3 Aug 2023 09:11:57 +0100 Subject: [PATCH] Added scripts to handle chunk processing Scripts added to /scripts to allow chunk processing findchunk.sh docker exec /scripts/findchunk.sh Returns internal paths of files related to that chunk deletechunk.sh docker exec /scripts/findchunk.sh Deletes files related to that chunk --- overlay/scripts/deletechunk.sh | 12 ++++++++++++ overlay/scripts/findchunk.sh | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 overlay/scripts/deletechunk.sh create mode 100644 overlay/scripts/findchunk.sh diff --git a/overlay/scripts/deletechunk.sh b/overlay/scripts/deletechunk.sh new file mode 100644 index 0000000..5942648 --- /dev/null +++ b/overlay/scripts/deletechunk.sh @@ -0,0 +1,12 @@ +#!/bin/bash +cd /data/cache + +if [[ "x$1" == "x" ]]; then + echo "Usage: docker exec /scripts/deletechunk.sh " + echo "" + echo "container is usually lancache_monolithic_1" + return +else + find /data/cache -type f -exec awk 'FNR>2 {nextfile} "$1" {rm FILENAME ; nextfile }' '{}' + +fi + diff --git a/overlay/scripts/findchunk.sh b/overlay/scripts/findchunk.sh new file mode 100644 index 0000000..c7987d8 --- /dev/null +++ b/overlay/scripts/findchunk.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cd /data/cache + +find /data/cache -type f -exec awk 'FNR>2 {nextfile} "$1" {print FILENAME ; nextfile }' '{}' + \ No newline at end of file