Update. I am trying to use rmlint to remove duplicates. I dont want to delete them -- just move them to a different drive. I would like the original directory structure preserved.
My original command was executed from:
Code:
/Volumes/rmlintTest/testData15may24/
The original command was
Code:
rmlint -gvbex -T df /Volumes/rmlintTest/testData15may24/
The destination tmp was at
Code:
/Volumes/rmlintTest/testData15may24/tmp
which produces a ".sh" output file containing the original rm_command code. I replaced that code with the following -- taken from rmlint documentation.
Code:
remove_cmd() {
echo 'Deleting:' "$1"
if original_check "$1" "$2"; then
if [ -z "$DO_DRY_RUN" ]; then
# was: rm -rf "$1"
mv -p "$1" "/tmp$1"
fi
fi
}
Here, I tried moving "$1" up a level from "." level -- namely a folder called tmp.
However, the folder tmp is misconstrued as being below Volumes, like this -- in MacOS.
cp: tmp/Volumes/rmlintTest/testData15may24/dir2/11-testLint.txt: No such file or directory.
I've tried cp instead of mv -- by cd'ing into the target folder before cp'ing. That does move the files -- but doesn't preserve the folder structure.
I've been on this for a while and am totally stumped. Assistance appreciated.