Results 1 to 3 of 3

Thread: Small problem using tar

  1. #1
    Join Date
    Aug 2006
    Location
    USA
    Beans
    291
    Distro
    Ubuntu 10.04 Lucid Lynx

    Small problem using tar

    Hi, I have a folder or web root, rather, I need to backup. Problem, exclude all subsites and only include just the files needed for the webapp.

    The contents, an old drupal install along with a number of subsites.

    Code:
    jms1989@compaq-linux:~/domains/www.compaq-web.org/public_html$ ls 
    anime          downloads    files     index.php          install.php  LICENSE.txt      misc     phpinfo.php  profiles    sites   torrent_files  Wallpaper
    CHANGELOG.txt  favicon.ico  gallery   INSTALL.mysql.txt  INSTALL.txt  mail             modules  poll         robots.txt  tf      update.php     webalizer
    cron.php       feeds        includes  INSTALL.pgsql.txt  lg           MAINTAINERS.txt  moviedb  poll.php     scripts     themes  UPGRADE.txt    xmlrpc.php
    The idea, tar all files related to drupal install.

    The reason, to backup before upgrade.

    Below is the command I've been trying to use.
    Code:
    tar -pczf backup.tar.gz --exclude=anime/ --exclude=downloads/ --exclude=feeds/ --exclude=files/ --exclude=gallery/ --exclude=lg/ --exclude=moviedb/ --exclude=poll/ --exclude=tf --exclude=Wallpaper/ --exclude=webalizer/ --exclude=backup.tar.gz ./
    The solution should be obvious but from the way I see it, it should be simple. The install isn't that big and yet it wants to create a 100mb+ file.

    Help will be appreciated.
    My PC: ASUS P5QC Motherboard w/ Intel Core2Quad 2.83GHz processor - 8GB of DDR2 800 RAM - nVidia GTX 550 TI 1GB - 1 500GB WD SATA Hard Drive - 750GB WD SATA Hard Drive - 2 ASUS DVD+/-RW DL Burners w/ Lightscribe

  2. #2
    Join Date
    Apr 2007
    Location
    Cullman, AL
    Beans
    652
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Small problem using tar

    Since you are pointing tar to the ./ directory, you need to use it in you excludes.
    Code:
    tar -pczf backup.tar.gz --exclude=./file ./
    Guide to forum text formatting code. Please use them | Use descriptive thread titles.

  3. #3
    Join Date
    Aug 2006
    Location
    USA
    Beans
    291
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Small problem using tar

    Thank you. It worked.
    My PC: ASUS P5QC Motherboard w/ Intel Core2Quad 2.83GHz processor - 8GB of DDR2 800 RAM - nVidia GTX 550 TI 1GB - 1 500GB WD SATA Hard Drive - 750GB WD SATA Hard Drive - 2 ASUS DVD+/-RW DL Burners w/ Lightscribe

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
  •