Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Linux Guru's.. I need RM command help..

Discussion in 'General Discussion' started by techark, Dec 29, 2002.

  1. techark

    techark Well-Known Member

    Joined:
    May 22, 2002
    Messages:
    280
    Likes Received:
    0
    Trophy Points:
    316
    OK I tried the new incremental backup feature in WHM and found out it is not going to work, filling hard drive up too fast.

    So I now need to remove the incremental back up dirs it made and leave the tar.gz's in place. Here is a sample of a ls on the backup.

    Anyone got a good way to do this without having to remove each dir one at a time so I can recover the used space and still leave my normal gziped backups in place?

    drissi/ lowcostt/ zukenet2/
    drissi.tar.gz lowcostt.tar.gz zukenet2.tar.gz

    Thanks
     
  2. fireform90

    fireform90 Active Member

    Joined:
    Aug 26, 2002
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    156
    If I understand you correctly, this is a relatively simple task.
    While viewing the directory you are in
    rm drissi -r
    rm lowcostt -r
    rm zukenet2 -r


    You could also move the .tar.gz with the mv command and remove the entire directory, recreate it then move them back.
     
  3. techark

    techark Well-Known Member

    Joined:
    May 22, 2002
    Messages:
    280
    Likes Received:
    0
    Trophy Points:
    316
    Yeah but I am trying to avoid having to rm them one at a time.

    320 accounts on this server and I have to do that in the daily, weekly,monthly directorys so I end up doing it 660 times. Trying to figure someway to automate it. ;-) I am lazy I'll admit it.
     
  4. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,574
    Likes Received:
    3
    Trophy Points:
    193
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Then do what fireform90 suggested.

    mv *.tar.gz somwhere
    then
    rm -Rf *

    Not exact but you get the picture.

    Put it all on one command line like this;

    mv *.tar.gz somwhere;rm -rf *
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. NiteStalker22

    NiteStalker22 Active Member

    Joined:
    May 13, 2002
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    301
    EH?!!!!!!

    cd into the directory.. then ......

    cd ../
    mv ./bkupdir ./newbkupdir

    OR

    cd into the directory..
    mv ./*.tar.gz ../somedirectory/
    cd ../
    rmdir ./bkupdir/

    Simple.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice