Tue, 04 Oct 2005

tar

tar jvcpsf foo.tar.bz2 DirectoryWithDotFile/ 
    // create a compressed archive called foo.tar.bz2 from
    // the contents of DirectoryWithDotFile/
    // j = compress thru bzip2
    // v = verbose
    // c = create
    // p = preserve permissions
    // s = same sort order on extract
    // f = name of archive file follows this argument

// To Move An Entire Directory

(cd /src/dir; tar cf - .) | (cd /dst/dir; tar xvfp -)
    or
cp -av /src/dir /dst/dir


// To backup a website using SSH and tar

ssh butakun@justhogs.org "tar cfzps - /home/butakun/www" > www.tar.gz

Posted at: 00:00 | category: /commands | Comments ()