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

Re: Auto-emptying of trash.



Hello Sharon, bob and everyone!

On Mon, 4 Mar 2013 02:29:09 +0000
Sharon Kimble <skimble04@gmail.com> wrote:
> [...] 
> 'atime' is not installed as its not in the wheezy repos, and
> when i want to install it apt-get comes back at me saying "E:
> Unable to locate package atime"

That is expected.  atime is not a package.  atime (UNIX-ish
short for "access time") is property of files/directories that
your filesystem takes care of any time a file is accessed--it
updates this field anytime the file is accessed.

You can review atime, mtime and ctime ("change time") using
mentioned `stat` command:

    me@here:~$ stat myfile.txt 
      File: `myfile.txt'
      Size: 6         	Blocks: 8          IO Block: 4096
    regular file
    Device: 805h/2053d	Inode: 285632      Links: 1
    Access: (0644/-rw-r--r--)  Uid: ( 1000/ me)   Gid:
    ( 1000/me)
    Access: 2013-03-04 04:47:02.929754566 +0100
    Modify: 2013-03-04 04:46:22.457204523 +0100
    Change: 2013-03-04 04:46:22.457204523 +0100
     Birth: -
    me@here:~$

However, there is at least one common exception to this
"anytime".  As you might know, in UNIX, file system tree is
very often composed of multiple partitions (e.g. different
for /home than for /usr or for /var), often using different
settings on how exactly kernel behaves to them.  One common
option is to tell kernel that for particular filesystem (or
"partition", if you prefer), you prefer *not* to have this
atime update done.  (Typically people do that for performance
reasons, e.g. on partitions that are designated for files for
which this information is not important.)

One way of knowing if this option is on (not sure if the most
reliable way) is running `mount` command which, if run without
arguments, shows where each filesystem is currently mounted to
which folder and which options are active.  You want to look
for "noatime" option:

    me@here:~$ mount             # shortened for readability
    [...]
    /dev/disk/by-uuid/f82f7997-1779-4bff-9f06-912e0019b79b on / type ext4
        (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
    tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
    tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=2049720k)
    /dev/sda9 on /var type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
    /dev/sda5 on /home type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
    /dev/sda7 on /mnt/pub type fuseblk (rw,nosuid,nodev,noatime,...)
    [...]
    me@here:~$

Notice the last two lines.  Partition /dev/sda5 is mounted
as /home does not have atime turned off (or "noatime" turned
on :)) Partition /dev/sda7, which I use as /mnt/pub *does* have
it (for whatever reason I had in mind when setting this up).

(For sake of correctness:  I was using terms "partition" and
"filesystem" kind of interchangeably.  It is not the same,
filesystem is not partition, it's something that "lives" on the
partition.)


> You give me the commands and i'll run them.

I do not recommend running any command without understanding it
first! :)

`rm -rf` yo mentioned in other post is *particularly* dangerous.
One typo and you could irreversibly screw up a LOT in no time!
(Remember that there's no such thing as "undelete" on
Linux/UNIX.)


> ls-l didn't show up any mention of trash/wastebin!

(It's typo, right? (I mean, it's `ls -l`).)

Without saying at least *where* (in what dir) you ran the
command, it is impossible to know whether the output is as
expected.  If you simply open your terminal, your shell starts
in $HOME, and since Trash is not in that folder, `ls -l` will
not mention it.  Correct.


Thanks,
aL.

-- 
Alois Mahdal


Reply to: