SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I was wondering if someone could help me with the proper syntax to tar and compress an entire directory and all subdirectories.

    For instance, I would like to tar up /home/reuben, /home/reuben/web, /home/reuben/test, etc. This way all directories and subdirectories in /home/reuben are added to the backup file.

    Also, is it possible to have the output file automatically placed in a different directory such as /etc/backup.

    Thanks

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is another thread about this, but I couldn't find it! Disappear into thin air! Anyway, try this:

    tar -cvf backup.tar dir
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks,

    I ended up finding a post at another forum that helped me and used the format tar -czfp backup.tar.gz dir. The problem is that the tar complained about the file being too big after it had backed up the first two gig. Is there anything special that I would need to do for larger files. The directory I am working with is about 10 gig.

  4. #4
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's a lot of files. I would suggest that you split the backup in to chunks and write a shell script, I assume that under the home dir you are backing up the files are split in to more directories?
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  5. #5
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    It is split into about 15000 directories, so that would probably work.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •