trash-cli
trash-cli copied to clipboard
trash-put --force-another-volume: Flag to override blocking of trashing between volumes
I use ZFS snapshots, so I made a dataset just for stuff I don't want to back up and link disposable items to it.
Here's the relevant datasets:
$ zfs list -o name,mountpoint,mounted
NAME MOUNTPOINT MOUNTED
zroot/encr/data/home /home yes
zroot/encr/disposable /mnt/disposable yes
...
This works:
$ file ~/.local/share/Trash
/home/bird/.local/share/Trash: symbolic link to /home/bird/deleteme.d
$ trash-put -v ~/deleteme
trash-put: Volume of file: /home
trash-put: Trash-dir: /home/bird/.local/share/Trash from volume: /home
trash-put: 'deleteme' trashed in ~/.local/share/Trash
However:
$ file ~./local/share/Trash
/home/bird/.local/share/Trash: symbolic link to /mnt/disposable/bird/Trash
$ trash-put -v ~/deleteme
trash-put: Volume of file: /home
trash-put: Trash-dir: /home/bird/.local/share/Trash from volume: /mnt/disposable
trash-put: found unusable .Trash dir (should be a dir): /home/.Trash
trash-put: Trash-dir: /home/.Trash-1000 from volume: /home
trash-put: Failed to trash deleteme in /home/.Trash-1000, because :[Errno 13] Permission denied: '/home/.Trash-1000'
trash-put: cannot trash regular empty file 'deleteme'
There's nothing wrong with permissions or the link:
$ touch ~/.local/share/Trash/deleteme
$ ls /mnt/disposable/bird/Trash/deleteme
/mnt/disposable/bird/Trash/deleteme
I also tested this with ext2 and by mounting directly to ~/.local/share/Trash to no avail.
I think this is reasonable default behavior and it's standards-compliant, but since the only workaround I can think of for this is to move or delete the Trash directory every time I need a snapshot, which is ridiculous, an override would be helpful. Maybe also another check and another flag to protect from and then override trashing of large files?