[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Auto-emptying of trash.



Thanks, after repopulating .trash with files suitable for deleting, i was able to test it out. And    ' find $HOME/.local/share/Trash -type f -mtime +7' did find one file, which i was then able to delete by running the same command again with '-delete' at the end. 

I now see in .trash that there are two directories, one dated 8th February, and one dated 16th February which should be eligible for deletion. Except, if you go by its properties date, it was last accessed 3/3/13, which means that its not deletable until the 10th. Is that correct please? 


On 3 March 2013 23:54, Bob Proulx <bob@proulx.com> wrote:
Sharon Kimble wrote:
> Thanks for this, and I've tried it out but its still not deleting files, as
> I output it to a txt.file which still remain empty.

Please say more.  It works for me.  You say it isn't deleting files
for you.  It is possible the permissions will prevent you from
deleting files but in that case there should be errors from the
command.  Please provide an example.

Start with this:

  find $HOME/.local/share/Trash -type f -mtime +7

If that prints files then adding the -delete option will delete them.
Honest! :-)

You say it isn't deleting files.  Pick a file that you think it should
delete but isn't deleting.  Show the file and the permissions of the
directory holding that file.  The permissions of the directory is the
important detail about creating or deleting files.

  ls -ld $HOME/.local/share/Trash/files/foo
  ls -ld $HOME/.local/share/Trash/files

I think that there simply are not any files old enough to need to be
aged away.  I think all of the files are current.  Since they are
current they do not meet your +7 days of mtime age that you originally
requested.  A +7 mtime age for trash files seemed reasonable to me.

> There is a programme, ported from ubuntu, called 'autotrash' in the repos.
> And although I've set it up as per its man page, but its output remains at
> zero, and not working.

Probably for the same reason.  Probably because the files are all
current and none of them old enough, past your seven day threshold, to
be candidates to be aged away.

The 'find' command will be easier to debug.  I would use it first to
figure things out.  Understanding a simple command is much better than
not understanding a magical black box.

> Maybe I'm going about this from the wrong end?

You have help here on the mailing list for your problem.  If you make
good use of it then you can understand and solve your task.  There is
no need to give up so easily.  Stick to it! :-)

Bob



--
A taste of linux = http://www.sharons.org.uk/taste/index.html
efever = http://www.efever.blogspot.com/
efever = http://sharon04.livejournal.com/
Debian Wheezy, LXDE 2 LibreOffice 3.5.4.2
Registered Linux user 334501




Reply to: