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.

How do i tar a folder?

Discussion in 'General Discussion' started by HH-Steven, Aug 2, 2006.

  1. HH-Steven

    HH-Steven Well-Known Member

    Joined:
    Aug 29, 2004
    Messages:
    284
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hi all

    Ok, so recently i had a hard drive failure, datacenter (layeredtech) were very quick to help out on this and they did an OS reload with a new drive and the old drive as slave.

    Most accounts were restored fine but now its come to the time when ive restored as much as i can and i am ready to tell the DC they can remove the slaved drive and do with it as they wish.

    What i want to do (in case of any requests for old data) is make a tar file of the /backups/ directory and also the /var/lib/mysql/ directory and download these to my local pc.

    The corresponding paths are:

    Slave drive is mounted as: /home/backup/

    Tar and download: /home/backup/backups/cpbackup/weekly/ (and monthly)

    Tar and download: /home/backup/var/lib/mysql/

    I plan on moving the tar files to a personal account of mine so i can then download them via the browser which i know how to do so i just need to know how to tar these folders up correctly.

    Any help is greatly appreciated, cheers.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    This will create a tarball in whatever your current directory is:

    tar -czf mysql.tar.gz /home/backup/var/lib/mysql

    etc.
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yes, that'd do it.

    I'd suggest two things:

    1. Make sure you've got unlimited quota on that account so you don't blow it

    2. Use FTP instead of downloading through your browser which would be a much greater hit on your server and less reliable than FTP
     
  4. HH-Steven

    HH-Steven Well-Known Member

    Joined:
    Aug 29, 2004
    Messages:
    284
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Right so im assuming that all i need to do is say:

    cd to the account i want to download them from say:

    cd /home/********/public_html/tardownload/

    then:

    tar -czf mysql.tar.gz /home/backup/var/lib/mysql

    tar -czf weekly.tar.gz /home/backup/backups/cpbackup/weekly

    tar -czf monthly.tar.gz /home/backup/backups/cpbackup/monthly

    Then these archives would be available from:

    domain.com/tardownload/

    ?
     
  5. HH-Steven

    HH-Steven Well-Known Member

    Joined:
    Aug 29, 2004
    Messages:
    284
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Strange how it put your reply above mine..........oh well

    Seems like i under estimated the size on some of these archives, god bless my 16 meg connection :D

    but.....thats exactly what i wanted chirpy, i was originally thinking of downloading them all via winscp but im sure you can imagine how long that would take.

    Cheers.
     
  6. mohsen2

    mohsen2 Registered

    Joined:
    Oct 23, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    How do i tar a folder without shell access?

    I'm looking for a PHP script tar a folder. Is there any other solution?
     
Loading...

Share This Page