From 905c512e7bd4cecd766ed59b54f621fecde909ae Mon Sep 17 00:00:00 2001 From: Dan Caseley Date: Mon, 25 Jul 2022 17:02:27 +0100 Subject: [PATCH] Add script to prune _data directories with sudo --- scripts/pruneDataDirectoriesWithSudo.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 scripts/pruneDataDirectoriesWithSudo.sh diff --git a/scripts/pruneDataDirectoriesWithSudo.sh b/scripts/pruneDataDirectoriesWithSudo.sh new file mode 100755 index 0000000..ea3c093 --- /dev/null +++ b/scripts/pruneDataDirectoriesWithSudo.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Get the path of the root of the project. It could be called from anywhere, so use this to get full paths. +# Assumes that this script lives in a directory, which lives in the root. +ROOTPATH="$( cd "$(dirname "$0")/.."; pwd -P )" + +find "$ROOTPATH" -name _data -type d -prune -exec sudo rm -rf {} \;