Home > Command & Utility > Exclude a Sub-directory in Tar Command

Exclude a Sub-directory in Tar Command

August 27, 2005 Posted by KP

To backup the directory /home/ to file /backups/home.tgz, and exclude /home/apachelog/ :

# cd /home
# tar czvf /backups/home.tgz –exclude apachelog/ *

(double ‘-’)

It may take a while, make it background:
# tar czf /backups/home.tgz –exclude apachelog/ * &

Bookmark and Share


Related Posts:

Filed Under: Command & Utility

Leave a Comment









*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word




Categories

Archives

Links

  • Dedicated Servers
  • Meta