ClearFoundation Tracker - ClearOS
View Issue Details
0018581ClearOSapp-flexshare - Flexsharespublic2018-01-12 10:352020-04-03 05:41
NickH 
NickH 
normalfeaturealways
closedsuspended 
7.4.0 
 
0018581: Add menu option to clear .trash items older than x days from flexshares
Currently, if you enable the recycle bin on Flexshares, deleted files build indefinitely in the .trash folders, eventually possibly filling the file system.

I think that there should be a user-configurable parameter for the number of days of old files to keep. This dropdown or input box could perhaps only be exposed if the recycle bin is enabled. A cron job could then be set up with something like:

tmpwatch 30d --all -m -q /var/flexshare/shares/*/.trash/

in it. Obviously change the 30d to however many days are chosen in the UI. The cron job may also have to take care of the custom flexshare location.

Note the more commonly touted solution is to use the following lines:
find /shares/*/.trash/ -type f -mtime +30 -exec rm -f {} \;
find /shares/*/.trash/ -type d -empty -exec rmdir {} \; > /dev/null 2>&1

but this can take a few days to delete a folder structure. Not a big issue but tmpwatch is neater.
No tags attached.
Issue History
2018-01-12 10:35NickHNew Issue
2018-01-13 03:28NickHNote Added: 0006961
2018-02-21 09:26user2Statusnew => acknowledged
2020-04-03 05:41NickHNote Added: 0013851
2020-04-03 05:41NickHStatusacknowledged => closed
2020-04-03 05:41NickHAssigned To => NickH
2020-04-03 05:41NickHResolutionopen => suspended

Notes
(0006961)
NickH   
2018-01-13 03:28   
Note the cron job would have to be a bit more detailed than my one-liner. The Recycled bin is enabled on a per-flexshare basis so the .trash would also need to be cleared on a per-flexshare basis as it would be possible to set different retention periods per flexshare.
(0013851)
NickH   
2020-04-03 05:41   
Migrated to https://gitlab.com/clearos/clearfoundation/app-flexshare/-/issues/19 [^]