[Bug 228369] [NEW] add an option to autodelete items from trash:/ after a specified span of time

2008-05-08 Thread Ritesh Raj Sarraf
Public bug reported:

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.

** Affects: gnome-desktop (Ubuntu)
 Importance: Undecided
 Status: New

** Affects: kdebase (Ubuntu)
 Importance: Undecided
 Status: New

** Also affects: gnome-desktop (Ubuntu)
   Importance: Undecided
   Status: New

-- 
add an option to autodelete items from trash:/ after a specified span of time
https://bugs.launchpad.net/bugs/228369
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gnome-desktop in ubuntu.

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs


[Bug 228369] Re: add an option to autodelete items from trash:/ after a specified span of time

2008-05-11 Thread Ritesh Raj Sarraf
Sebastien,

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

-- 
add an option to autodelete items from trash:/ after a specified span of time
https://bugs.launchpad.net/bugs/228369
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to nautilus in ubuntu.

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs


[Bug 228369] Re: add an option to autodelete items from trash:/ after a specified span of time

2008-05-11 Thread Ritesh Raj Sarraf
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?

-- 
add an option to autodelete items from trash:/ after a specified span of time
https://bugs.launchpad.net/bugs/228369
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to nautilus in ubuntu.

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs


[Bug 228369] Re: add an option to autodelete items from trash:/ after a specified span of time

2008-05-11 Thread Ritesh Raj Sarraf
[EMAIL PROTECTED]:~$ 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
[EMAIL PROTECTED]:~$ 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.

-- 
add an option to autodelete items from trash:/ after a specified span of time
https://bugs.launchpad.net/bugs/228369
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to nautilus in ubuntu.

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs