I found out that multiple entries of assignfeedback_editpdf was autogenerated whenever a student submit a image file or a teacher issues a image feedback file, the total filesize of the multiple assignfeedback_editpdf entries was about 4x - 5x the size of the actual uploaded file. we ran low disk space and decided to uninstall AnnotatePDF plugin so that all of its related data will be deleted as well, after uninstallation i run moosh file-delete --flush to immidiately emty the trashcan and its a success we recover about 50GB of disk space, but upon checking the mdl_files table, there's still 28GB assignfeedback_editpdf where filearea are 'tmp_jpg_to_pdf' & 'stamps'. How can i properly removed these remaining data, so that the deletion will be cascaded to all of its related data and no orphan records will be left?
How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Nope I'm not doing manual deletion to any of the tables, what I did was every time our disk quota is about 80% full I again uninstall the AnnotatePDF plugin - that trick frees up ~40GB of our dusk space.
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
In moodledata/temp/assignfeedback_editpdf/pageimages folder there is usually number of subfolders with long random names like 00e24d2e392c898e771c20fdc90ee52dce173733. content inside are pdf files.
Not sure if this is auto delete when removed from database, I have few GB already and growing
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
This is a longer known, annoying bug in this plugin:
https://tracker.moodle.org/browse/MDL-69570
I can't understand why it isn't still not fixed.
In our moodle we have to clean up these orphaned files (10GB every week) continuously with moosh and bash-shellscripts.
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
I don't have moosh installed, so my approach is different, although still using bash. It assumes that you have a separate DB Server to connect through ssh, but that can be changed easily. The select statement creates a deletelist shellscript which is then executed and removes the physical files. Afterwards the db entries in mdl_files are removed.
mytime="1 YEAR"
sqluser"yourusername"
sqlPW="yourpassword"
#create deletelist script
ssh user@yourserver "mysql -u$sqluser -p$sqlPW yourmoodle_db -e \"SELECT DISTINCT CONCAT('rm -f /path/to/moodledata/filedir/', LEFT(mdl_files.contenthash, 2),'/', MID(mdl_files.contenthash, 3, 2),'/', mdl_files.contenthash,';') AS shellscript FROM mdl_files WHERE component = 'assignfeedback_editpdf' AND timecreated < UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL $mytime));\"" > clear.sh;
#modify and execute deletelist script
sed -i '1d' clear.sh
chmod +x clear.sh
/path/to/clear.sh;
#delete database entries
ssh user@yourserver "mysql -u$sqluser -p$sqlPW yourmoodle_db -e \"DELETE FROM mdl_files WHERE component = 'assignfeedback_editpdf' AND timecreated < UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL $mytime));\"";
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Is anyone able to write a moodleplugin doing this?
Then this could be used via backend by those who don't have access to the server.
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
https://github.com/toniginard/moodle/commit/682bf166a11961cff407f87cd6b5aa0d81c90f38
https://github.com/toniginard/moodle/commit/c625d604cc8d06948f7dddc47348ced410dcdae6
see also moodletracker:
https://tracker.moodle.org/browse/MDL-69570?focusedCommentId=876536&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-876536
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Is there any fix now of this issue without coding for those we are afraid of doing it?
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
Re: How to properly manual delete the remaining 'assignfeedback_editpdf' after uninstalling the AnnotatePDF plugin
https://tracker.moodle.org/browse/MDL-69570