The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help with managing/calculating "nobody" file usage

Discussion in 'General Discussion' started by alankru, Mar 7, 2012.

  1. alankru

    alankru Member

    Joined:
    Jan 2, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I am already running suPHP, but I have some very old clients that transferred their files over many years ago and I am now trying to do something about the "nobody" files that they have in their home directories. Would someone be able to help me with the following please?

    1. How would I go about finding the user's that have files in their home directories that are owned by "nobody"? I know that I can do
    Code:
    #find /home -user "nobody"
    however, I would like to have a summary of the locations where these files are, rather than a verbose listing of every file. Is this possible?

    2. A long time ago, I was given a command to scan a user's home directory and calculate the disk usage of their "nobody" files:

    Code:
    find /home/directory -user nobody | xargs -i du -b "{}" | awk '{sum+=$1} END {print sum/1024/1024" MB"}'
    However, when I run this command on an example user, it doesn't show the true disk usage as their "nobody" files are contained to their forum uploads and, according to cPanel disk usage viewer, their "nobody" files amount to a figure ~100MB smaller than what I got with the above command (which seems correct). Furthermore, if I use the same command to find files owned by the example user, it comes back with 6GB, which is not correct either as they have a quota of 800MB. So clearly something isn't right with that command.

    Any help would be appreciated. Thank you.
     
  2. alankru

    alankru Member

    Joined:
    Jan 2, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page