0
Fixed

How to use cron/empty_trash.php?

Matthias B 5 years ago updated by Vlad R 4 years ago 5

I'm trying to figure out how to get cron/empty_trash.php to delete files for one user only and only files of a certain age, but no matter what I tried, it always deletes everything.


e.g.


php ../htdocs/cron/empty_trash.php superuser 14
-------------------- START ----------------------
Emptying trash for "gameswelt":
       Removing 6 items...Ok
Emptying trash for "superuser":
       Removing 1 items...Ok
------------------- END --------------------------

removes everything. How do you supply parameters to this script? I've tried --username USER --days 14, username:USER days:30 and several other things, to no avail. 

php ../htdocs/cron/empty_trash.php  --username superuser --days 14

I have corrected the answer. I have also tested it now and I can confirm that it is not working as expected. I have changed your post to a bug report, and it will get fixed with the next update. In the meantime, use a user ID instead of username as a workaround. So instead of "superuser" use "1". The user IDs are listed in the last column in the list of users from the FileRun control panel.

Thanks! --username 1 --days 14 seems to work indeed.

Fixed

A FileRun update is now available for installation. It includes a fix for the mentioned problem. The parameter is now actually expected to be a FileRun username, and not an ID.

For installing updates, please use this guide: https://docs.filerun.com/updating