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.

Disk Space

Discussion in 'General Discussion' started by big_bull, Nov 26, 2009.

  1. big_bull

    big_bull Well-Known Member

    Joined:
    Nov 19, 2006
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hello,

    From last few days for my server IP saw disk space issue, when checked further found some users have uploaded some files but upload process is not completed and the files are like

    .pureftpd-upload.4b0bdc64.15.5449.deba5ffe
    .pureftpd-upload.4b0d1457.15.347.e67dbd96
    .pureftpd-upload.4b0d185a.15.240a.e5de7f05
    .pureftpd-upload.4b0bee93.15.1f09.7f1ac407
    .pureftpd-upload.4b0d3029.15.796c.d619b16d

    How to delete all these files from client's accounts?
     
  2. jrianto

    jrianto Active Member

    Joined:
    Jun 9, 2008
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    What if you remove these temp files then restart ftp server? It should disconnect the upload session I suppose.
     
  3. big_bull

    big_bull Well-Known Member

    Joined:
    Nov 19, 2006
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Yes,

    My concern is that how to delete all these files in bulk, any shell script?
     
  4. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Using "find" to locate temporary files from FTP uploads via Pure-FTPd

    It is possible using a tool such as "find" to locate files matching specified criteria and have it execute another command for each search result.

    Here is an example that will only iterate the search results:
    Code:
    # find /home -mindepth 2 -name ".pureftpd-upload.*"
    Here is an example that will execute an "ls" command for each:
    Code:
    # find /home -mindepth 2 -name ".pureftpd-upload.*" -exec ls -adhl '{}' \;
    In this next example, replace "username" with the actual username of the desired account; this example will search the primary document root directory "public_html" of the specified user account and for each result it will execute an "rm" command including the use of the CLI switches "-i" for interactive mode and "-v" for verbose output to prompt to confirm each removal and output verbose results of any activity performed: Please use extreme caution if using or editing the command and understand that "rm" will permanently remove data; proceeding is at ones own risk.
    Code:
    # find /home/username/public_html -name ".pureftpd-upload.*" -exec rm -iv '{}' \;
     
  5. big_bull

    big_bull Well-Known Member

    Joined:
    Nov 19, 2006
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Really thanks for this,

    will you please provide a link where I can check basics for shell scripting. It will be a great help.
     
  6. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    I recommend using an Internet search engine to locate related articles and guides; using the requested topic of "shell scripting" here is an example query using Google as the search engine: shell scripting - Google Search
     
  7. big_bull

    big_bull Well-Known Member

    Joined:
    Nov 19, 2006
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Well,

    When I used
    find /home -type f -name '.pureftpd-upload*' |awk '{print "rm -rf " $9}'

    it just prints "rm -rf" only

    It should have print

    rm -rf .pureftpd-upload.4b0bdc64.15.5449.deba5ffe
    rm -rf .pureftpd-upload.4b0bdc64.15.5449.dede5De
    rm -rf .pureftpd-upload.4b0bdc64.15.5449.de85fres
     
  8. big_bull

    big_bull Well-Known Member

    Joined:
    Nov 19, 2006
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Will you please correct it?
     
  9. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    If you want to delete the files directly use,

    find /home -type f -name '.pureftpd-upload*' | xargs rm -f

    if you want to display them in the format

    rm -rf /home/user/directory/.pureftpd-upload.4b0bdc64.15.5449.deba5ffe

    use,

    find /home -type f -name '.pureftpd-upload*' |awk '{print "rm -rf " $1}'
     
Loading...

Share This Page