Results 1 to 6 of 6

Thread: How do i tar a folder?

  1. #1
    Member
    Join Date
    Aug 2004
    Posts
    295
    cPanel/WHM Access Level

    Root Administrator

    Default How do i tar a folder?

    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. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    This will create a tarball in whatever your current directory is:

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

    etc.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,496

    Default

    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
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  4. #4
    Member
    Join Date
    Aug 2004
    Posts
    295
    cPanel/WHM Access Level

    Root Administrator

    Default

    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. #5
    Member
    Join Date
    Aug 2004
    Posts
    295
    cPanel/WHM Access Level

    Root Administrator

    Default

    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

    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. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    1

    Default

    How do i tar a folder without shell access?

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

Similar Threads

  1. pkgacct without tar all of the folder
    By belon_cfy in forum Data Protection
    Replies: 0
    Last Post: 02-23-2011, 08:58 AM
  2. cpbackup .tar instead of tar.gz
    By Raffi in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 12-08-2008, 07:33 AM
  3. backup with folder as well as tar.gz file
    By alluser in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 12-15-2007, 02:38 PM
  4. sync folder from 1 web directory folder and network vpn
    By khambalya in forum cPanel & WHM Discussions
    Replies: 0
    Last Post: 07-29-2007, 05:08 AM
  5. SP2 Backups tar.tar or tar.gz
    By JudgeJeffries in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 09-19-2004, 05:20 PM