Hi
The scripts are too specific to our installation to share them, but I can tell you how I do it:
First I get a list of the ids of all courses in the category, from which I want to purge all editpdf-files:
moosh -n -p $moodlepath -c $catid | awk -F, '{ print $1 }' | tr -d \" >$tmpfile
(You can use moosh -n category-list $category-name to find a categories id)
Then I scan these courses for the editpdf-files:
rm $editpdffiles 2>/dev/null
i=0
while read -r cid; do
i=$((i + 1))
[ $i -eq 1 ] && continue;
moosh -n -p $moodlepath file-list course=$cid \
| grep -e "assignfeedback_editpdf" \
| grep -v -e ":stamps:" \
>>$editpdffiles
done < $tmpfile
This gives a list of all these files. Here a sample line:
1581580 0 .... f111716a9e35eea8aa735106e3cba13857eae832 Saturday, 10. April 2021, 10:13 77645:assignfeedback_editpdf:combined:40147 combined.pdf
---
You can now purge all these files (or filter them before by date as I do)
cat $editpdffiles | moosh -n -p $moodlepath file-delete -s
Hope it helps a bit.
But be careful and check all twice, so you not delete something wrong