------------------------------------------------------------------------------- The Desktop trashcan spec https://specifications.freedesktop.org/trash-spec/trashspec-latest.html Trash is located at $HOME/.local/share/Trash /{mountpath}/.Trash-{uid} It is NOT a good idea to use "find-rm" to remove older files from the trashcan. That is you trash a directory with some old files it in. Next 'find' run and those old files get removed, even though the directory was just trashed! Basically Trashcan is designed to not only keep a backup of files, but keep a backup with there original file meta data, including age! From the Spec... If a directory was trashed in its entirety, it is easiest to undelete it or remove it from the trash only in its entirety as well, not as separate files. NOTES: * The filename used in the trash directory does NOT need to match the original name of the 'file path'. Gnome ("gio") assumes the name is something the user can follow. While "trash-cli" uses the original file path instead. * "code-server' web user interface (v2), will use random UUIDs for the trash filenames and directories, making the use of "gio" difficult. It also includes micro-seconds in the recorded deletion time, and some programs may not work correctly with this extra qualification. For example.. =======8<-------- [Trash Info] Path=/home/user/public_html/webAppDev/week10/.env DeletionDate=2019-08-27T05:20:31.377Z =======8<-------- There is no final newline on that last line! ------------------------------------------------------------------------------- CLI Utilities gio Desktop file handler using URLs, (for file managers) This does not * erase older trash files * only reports the trash (info) filenames * does not report the original deletion date, or original filename * cannot retore to original path, but you can 'move' files out of trash. gio trash [filename...] # trash files (uses original filename) gio trash --empty # erase trash gio list trash:// # list the trashcan (using info filenames) gio list -l trash:// # list the trashcan with size and types # Size is in blocks of 512b! gio tree trash:// # list trash/info to trash/file pointers # using info filenames, not restore name gio remove trash:///file # erase specific file gio move trash:///file restore # move out from trash autotrash An small python utility to delete older files from trash. https://github.com/bneijt/autotrash/ * can specify a particular directory to remove * Can remove older ones bases on disk limits rather than (or with) time * It crashes due to a python error on micro-second time stamps. Generated by "code-server". However version 0.3.0 has this fixed trash-cli In general this works, and provides ways to remove 'old' trash, but has some problems, showing it is not mature. It is also not in active development. Latest version (v0.21+, at time of write fedora RPM is only v0.20) pip install trash-cli Issues and reporting https://github.com/andreafrancia/trash-cli trash-list # list trash files (using original path) # sorted by the info file 'mtime' NOT recorded date # Options... # --trash-dir={trashdir} -- very useful # --size -- hidden option v0.21+ # trash {files...} # send these files to trash trash-rm {pattern} # remove these original paths from trash trash-empty # remove ALL trashed files trash-empty {days} # remove older trash Problems * Size is as per gio, and seems to have no relation to actual size https://github.com/andreafrancia/trash-cli/issues/149 #issuecomment-840341577 * how to specify to only empty a specific trashcan? * does trash-list report which trash-dir the file is in? Software does not appear to be updated very often! systemd-tmpfiles Configs... /etc/tmpfiles.d/ # not used in fedora /usr/lib/tmpfiles.d/ ~/.config/user-tmpfiles.d/ ~/.local/share/user-tmpfiles.d/ This is run regularly by systemd for clean up of system and users. It can create and delete directories, files, FIFO's, and recursively set ownership/groups/attributes for files, including logs. It can also do specific actions at boot time, to clean and prepare system. However it does not appear to understand the complexity of Trash. -------------------------------------------------------------------------------