Results 1 to 3 of 3

Thread: TAR command

  1. #1

    TAR command

    I have a minor question. I am learning some shell scripting, and wrote a little thing to back up some directories as TAR archives. Let's say I want to back up /home/ron/crap/ (so I really only want the 'crap' directory backed up) for some reason, when I untar the archive, it does the whole tree, starting at /home/. Any ideas? Oh, the script uses 'tar -cvjf'.
    Asus A8V Deluxe Mobo
    AMD Athlon64 X2 4400 -939
    2GB Crucial DDR3200 Dual-Channel
    ATi AiW 9800 Pro 128DDR
    Audigy2 ZS
    Sony DRU-810 DVD+RW DL
    3 x Maxtor MaxLine SATA 160Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 300Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 120Gb 16Mb Cache

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Posts
    304

    Re:TAR command

    Rather than have your script "tar cvfj /home/ron/crap/" have the script do this:
    cd /home/ron/ && tar cvfj ./crap/

  3. #3

    Re:TAR command

    That's nice ;D It never even occurred to me to do it that way. Thanks!
    Asus A8V Deluxe Mobo
    AMD Athlon64 X2 4400 -939
    2GB Crucial DDR3200 Dual-Channel
    ATi AiW 9800 Pro 128DDR
    Audigy2 ZS
    Sony DRU-810 DVD+RW DL
    3 x Maxtor MaxLine SATA 160Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 300Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 120Gb 16Mb Cache

Similar Threads

  1. BBIPS - Command Line Utilities
    By Crouse in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 09-05-2007, 03:04 AM
  2. Simple question about command syntax ping/log ping results
    By ohalnet in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 07-26-2006, 05:12 PM
  3. How to start System Restore tool at command prompt
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-04-2005, 07:25 AM
  4. install and use the Recovery Console in Windows XP
    By regix in forum Windows - General Topics
    Replies: 14
    Last Post: 01-04-2005, 06:35 AM

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
  •