trash-cli
trash-cli copied to clipboard
trash-empty ignores NFS mountpoints
Describe the bug
trash-empty
command does not list and clean NFS mountpoints.
The problem was introduced at commit 22e655b3 to solve issue #214. PR #178 fixed same problem before.
trash-cli version
trash-put 0.22.4.16
Operating system:
Ubuntu 22.04
To Reproduce
- Mount NFS
- Execute
trash-empty
$ sudo mount -t nfs4 nfsserver:/export /mnt/nfs
$ trash-empty
Would empty the following trash directories:
- /home/user/.local/share/Trash
- /.Trash-1000
- /home/.Trash-1000
- /boot/.Trash-1000
- /boot/efi/.Trash-1000
Proceed? (y/n)
Expected behavior
trash-empty
should list and clean trash directories in NFS mountpoints too.
$ sudo mount -t nfs4 nfsserver:/export /mnt/nfs
$ trash-empty
Would empty the following trash directories:
- /home/user/.local/share/Trash
- /.Trash-1000
- /home/.Trash-1000
- /boot/.Trash-1000
- /boot/efi/.Trash-1000
- /mnt/nfs/.Trash-1000
Proceed? (y/n)
Or trash-empty
should check all mountpoints and simply ignore it if the trash directory does not exist.
$ sudo mount -t nfs4 nfsserver:/export /mnt/nfs
$ trash-empty
Would empty the following trash directories:
- /home/user/.local/share/Trash
- /mnt/nfs/.Trash-1000
Proceed? (y/n)
Related issues
issue #214, PR #178
Understood.
Unfortunately at the moment I am unable to implement the solution soon. If anyone wants to send a pull request they are welcome.
I installed trash-cli with pip today, and found that I needed to use the fix in PR https://github.com/andreafrancia/trash-cli/pull/230 in order for the trash-list
command to list the items trashed on my primary NFS filesystem.
The PR #230 seems good, I just need someone that can test it on an environment with NFS mount points. At the moment I don't have yet access to any machine with NFS where I can test trash-cli. If you want to use #230 PR try this:
$ pip uninstall trash-cli
$ pip install git+https://github.com/masgouri/trash-cli@patch-1
If the patch works please add a comment to this page letting me know. I will merge the patch.
The patch as applied through pip install
works for me!
Thank you @ehusby
nfs fstype is fixed by #230, but nfs4 fstype is not still fixed. Please merge #244.
Merged! Thank you @ytoku