add an option to autodelete items from trash:/ after a specified span of time

Bug #228369 reported by Ritesh Raj Sarraf
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KDE Base
Fix Released
Wishlist
Nautilus
Fix Released
Wishlist
gnome-settings-daemon (Ubuntu)
Fix Released
Wishlist
Unassigned
kdebase (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

It would be good to have an expire kind of option for the Trash folders in [K]ubuntu.

In the current mode, the Trash folder is useless. Users will either do a Shift + Delete or Delete + Empty Trash.
If an expiry option is provided, it'll help a lot.

An example:
I use the laptop running Kubuntu. I take backups almost daily onto an external HDD. If I go with the current mode, when I delete, I do:
* Shift + Delete or
* Delete + Empty Trash.

In both cases a backup of the data is no more available.

If you implement the feature I'm requesting for, I'd do it in the following way.
* Set Trash Item Expire to 15 days.
* Throw unneeded items to Trash and forget.
* In 1-2 days, they'd get backed-up to my external HDD
* On the 15th day, they'd be _deleted_

Whoops......... I need that data back.

No problem. I still must be having it in my backup HDD.

Please, add this feature.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the bug report. This particular bug has already been reported, but feel free to report any other bugs you find.

Changed in gnome-desktop:
importance: Undecided → Wishlist
status: New → Invalid
Revision history for this message
Ritesh Raj Sarraf (rrs) wrote :

Sebastien,

Can you please provide the link to the original bug report?

Ralph Janke (txwikinger)
Changed in kdebase:
importance: Undecided → Wishlist
Changed in kdebase:
status: Unknown → Confirmed
Revision history for this message
Ralph Janke (txwikinger) wrote :

Confirmed due to the existence of the feature request upstream

Changed in kdebase:
status: New → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

not sure about the ubuntu bug, looking for exact numbers for the ton of duplicates sent is lot of work and the team is already overworked so prefer to focus on fixing issues rather, http://bugzilla.gnome.org/show_bug.cgi?id=149572 upstream is about that for example

Changed in nautilus:
status: Invalid → Triaged
Changed in nautilus:
status: Unknown → Confirmed
Revision history for this message
Ritesh Raj Sarraf (rrs) wrote :

Thank you. The upstream bug reports are helpful.

Both the bug reports are quite old but with no fix downstream yet. So I'm not sure when we could see this in [K]ubuntu.

I hope we all are aware of tmpreaper. It cleans files/folders in /tmp based on how old they are.
Probably, till it gets fixed, I'll use something similar to it. TrashReaper?

Should a TrashReaper kind of approach be proposed for the next release?

Revision history for this message
Ritesh Raj Sarraf (rrs) wrote :

rrs@learner:~$ cat .kde/shutdown/TrashReaper
#!/bin/bash

#Removes old files from the KDE trash folder (KDE >= 3.4)
#(c) 2005 Bram Schoenmakers

# http://bram85.blogspot.com/2005/11/only-good-for-trash-bin.html

EXPIREDATE=`date -d'30 days ago' +%Y%m%d`
TRASHDIR=~/.local/share/Trash

cd $TRASHDIR/info

for ITEM in *.trashinfo; do
  ITEMNAME=`echo "$ITEM" | sed -e 's/.trashinfo//'`

  #extract date
  TRASHDATE=`grep DeletionDate "$ITEM" | sed -e 's/^.*\(....\)-\(..\)-\(..\)T.*$/\1\2\3/'`

  if [ $TRASHDATE -le $EXPIREDATE ]; then
    rm -rf "$TRASHDIR/files/$ITEMNAME"
    rm -f "$TRASHDIR/info/$ITEM"
    #echo "$TRASHDIR/files/$ITEMNAME"
    #echo "$TRASHDIR/info/$ITEM"
  fi
done
rrs@learner:~$ crontab -l
# m h dom mon dow command
@daily ~/.kde/shutdown/TrashReaper

With this script in ~/.kde/shutdown and a cronjob to run daily, Trash auto-delete can be accomplished.

Changed in kdebase:
status: Confirmed → Triaged
Changed in kdebase:
status: Confirmed → Fix Released
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

This has been implemented for KDE 4.2.

Changed in kdebase:
status: Triaged → Fix Released
Changed in nautilus:
assignee: nobody → desktop-bugs
Revision history for this message
Sancho Panza (prashanthr-deactivatedaccount-deactivatedaccount) wrote :
Changed in nautilus:
importance: Unknown → Wishlist
Omer Akram (om26er)
Changed in nautilus (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
Changed in kdebase:
importance: Unknown → Wishlist
Changed in nautilus:
status: Confirmed → Fix Released
affects: nautilus (Ubuntu) → gnome-settings-daemon (Ubuntu)
Changed in gnome-settings-daemon (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.