Added scripts to handle chunk processing

Scripts added to /scripts to allow chunk processing

findchunk.sh
docker exec <container> /scripts/findchunk.sh <chunk>
Returns internal paths of files related to that chunk
deletechunk.sh
docker exec <container> /scripts/findchunk.sh <chunk>
Deletes files related to that chunk
This commit is contained in:
James Kinsman 2023-08-03 09:11:57 +01:00 committed by GitHub
parent 8392ba6613
commit ee622fe875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#!/bin/bash
cd /data/cache
if [[ "x$1" == "x" ]]; then
echo "Usage: docker exec <container_name> /scripts/deletechunk.sh <chunk path>"
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

View file

@ -0,0 +1,5 @@
#!/bin/bash
cd /data/cache
find /data/cache -type f -exec awk 'FNR>2 {nextfile} "$1" {print FILENAME ; nextfile }' '{}' +