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.

delete backup files using putty

Discussion in 'General Discussion' started by indous, Nov 20, 2009.

  1. indous

    indous Registered

    Joined:
    Nov 20, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    How can I delete back up files using putty (SSH). I want to know the commands.
     
  2. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    What kind of backup files do you want to delete. Go to the folder where the backup files are located using the command below.

    cd /path/to/backup/folder/

    The command below will delete the file named 'backup-file'.

    rm backup-file
     
  3. mickbeng

    mickbeng Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Penang, Malaysia
    you may use rm to remove a file.

    rm remove file
    rm -r remove file with recursive
    rm -f force remove

    normally backup file located at /backup/cpbackup/.
     
  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:
    Removing files via command-line (CLI) SSH access

    Please use the following command to review the official manual "man" page for the "rm" utility:
    Code:
    # man rm
    Via SSH, the "rm" command could be used; however, this must be done so carefully so as to not inadvertently remove important or required data.

    The command-line (CLI) switch "-r" should only be used if needing to "recursively" remove a directory and all of the contents within that directory. As a safety precaution, I recommend to not use this option unless absolutely required for removing an entire directory structure and its contents.

    The CLI switch "-v"may be used to enable verbose output that will explain what is being done, such as indicating when a file is removed. I recommend using this option so that there will be a more visual record of what actions are performed, excellent for copying-and-pasting.

    The CLI switch "-f" may be used if needing to force the removal without prompting and ignoring nonexistent files.

    The CLI switch "-i" may be used if needing to interactively confirm the removal of each file by answering a prompt for yes or no; this may be a desired option to use if there is any uncertainty involved in what is needing to be removed.

    The following example could be used to forcefully remove a file named "backupfile.tar.gz" that is located in the same directory that you're currently in (where "backupfile.tar.gz" should be replaced with the actual file name involved):
    Code:
    # rm -fv backupfile.tar.gz
    The following example could be used to interactively remove a file named "backupfile.tar.gz" located in a directory path of "/path/to/" (where "/path/to/backupfile.tar.gz" should be replaced by the actual directory path and file name of the file to remove):
    Code:
    # rm -iv /path/to/backupfile.tar.gz
     
  5. lanka

    lanka Registered

    Joined:
    Sep 13, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi there, I used tht command on ssh & nothing happend, where the error?
     
  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:
    Multiple commands were discussed in this thread. Please clarify exactly what command was used and what you were expecting to happen using the specific command.

    The following command may be used to obtain a history of the commands entered for the user you are logged-in as:
    Code:
    # history
     
Loading...

Share This Page