BetaONE will rise again!


Reply
  #1  
Old 18th Jul 02, 09:33 PM
pcservicetech's Avatar
pcservicetech pcservicetech is offline
Senior Member
 
Join Date: Dec 2002
Location: United States
Posts: 280
pcservicetech is an unknown quantity at this point
Lets say I have a folder on c:\ and I want to tar archive it's contents including sub-directories what would the command line be?

This is the tar help file:

Main operation mode:
-t, --list list the contents of an archive
-x, --extract, --get extract files from an archive
-c, --create create a new archive
-d, --diff, --compare find differences between archive and file system
-r, --append append files to the end of an archive
-u, --update only append files newer than copy in archive
-A, --catenate append tar files to an archive
--concatenate same as -A
--delete delete from the archive (not on mag tapes!)

Operation modifiers:
-W, --verify attempt to verify the archive after writing it
--remove-files remove files after adding them to the archive
-k, --keep-old-files don't overwrite existing files when extracting
-U, --unlink-first remove each file prior to extracting over it
--recursive-unlink empty hierarchies prior to extracting directory
-S, --sparse handle sparse files efficiently
-O, --to-stdout extract files to standard output
-G, --incremental handle old GNU-format incremental backup
-g, --listed-incremental handle new GNU-format incremental backup
--ignore-failed-read do not exit with nonzero on unreadable files

Handling of file attributes:
--owner=NAME force NAME as owner for added files
--group=NAME force NAME as group for added files
--mode=CHANGES force (symbolic) mode CHANGES for added files
--atime-preserve don't change access times on dumped files
-m, --modification-time don't extract file modified time
--same-owner try extracting files with the same ownership
--numeric-owner always use numbers for user/group names
-p, --same-permissions extract all protection information
--preserve-permissions same as -p
-s, --same-order sort names to extract to match archive
--preserve-order same as -s
--preserve same as both -p and -s

Device selection and switching:
-f, --file=ARCHIVE use archive file or device ARCHIVE
--force-local archive file is local even if has a colon
--rsh-command=COMMAND use remote COMMAND instead of rsh
-[0-7][lmh] specify drive and density
-M, --multi-volume create/list/extract multi-volume archive
-L, --tape-length=NUM change tape after writing NUM x 1024 bytes
-F, --info-script=FILE run script at end of each tape (implies -M)
--new-volume-script=FILE same as -F FILE
--volno-file=FILE use/update the volume number in FILE

Device blocking:
-b, --blocking-factor=BLOCKS BLOCKS x 512 bytes per record
--record-size=SIZE SIZE bytes per record, multiple of 512
-i, --ignore-zeros ignore zeroed blocks in archive (means EOF)
-B, --read-full-records reblock as we read (for 4.2BSD pipes)

Archive format selection:
-V, --label=NAME create archive with volume name NAME
PATTERN at list/extract time, a globbing PATTERN
-o, --old-archive, --portability write a V7 format archive
--posix write a POSIX conformant archive
-z, --gzip, --ungzip filter the archive through gzip
-Z, --compress, --uncompress filter the archive through compress
--use-compress-program=PROG filter through PROG (must accept -d)

Local file selection:
-C, --directory=DIR change to directory DIR
-T, --files-from=NAME get names to extract or create from file NAME
--null -T reads null-terminated names, disable -C
--exclude=PATTERN exclude files, given as a globbing PATTERN
-X, --exclude-from=FILE exclude globbing patterns listed in FILE
-P, --absolute-names don't strip leading `/'s from file names
-h, --dereference dump instead the files symlinks point to
--no-recursion avoid descending automatically in directories
-l, --one-file-system stay in local file system when creating archive
-K, --starting-file=NAME begin at file NAME in the archive
-N, --newer=DATE only store files newer than DATE
--newer-mtime compare date and time when data changed only
--after-date=DATE same as -N
--backup[=CONTROL] backup before removal, choose version control
--suffix=SUFFIX backup before removel, override usual suffix

Informative output:
--help print this help, then exit
--version print tar program version number, then exit
-v, --verbose verbosely list files processed
--checkpoint print directory names while reading the archive
--totals print total bytes written while creating archive
-R, --block-number show block number within archive with each message
-w, --interactive ask for confirmation for every action
--confirmation same as -w

Thanks/pc
Reply With Quote
  #2  
Old 19th Jul 02, 12:02 AM
Shiromagius Shiromagius is offline
Senior Member
 
Join Date: Oct 2001
Location: Oregon
Posts: 244
Shiromagius
Send a message via ICQ to Shiromagius
I am no expert, but when I tar stuff I usually do something along the lines of: tar -cvzf <archive name> <what to tar>. So in your case you might go to your working directory and then do "tar -cvzf myfiles.tar.gz *"
Again, I am no expert, and am not sure if that will grab the folders as well, but its worth a try right?
__________________
Shiromagius
Reply With Quote
  #3  
Old 22nd Jul 02, 01:32 AM
DewLaSing DewLaSing is offline
Junior Member
 
Join Date: Nov 2001
Posts: 29
DewLaSing
Quote:
Originally posted by Shiromagius@Jul 18 2002, 06:02 PM
I am no expert, but when I tar stuff I usually do something along the lines of: tar -cvzf <archive name> <what to tar>. So in your case you might go to your working directory and then do "tar -cvzf myfiles.tar.gz *"
Again, I am no expert, and am not sure if that will grab the folders as well, but its worth a try right?
This is correct....as long as the directory name is in the archive name space, it'll tar everything underneath it

tar -cvpzf <archive name> <what to tar>


i usually add "p" to retain the permissions
Reply With Quote
  #4  
Old 22nd Jul 02, 02:58 PM
pcservicetech's Avatar
pcservicetech pcservicetech is offline
Senior Member
 
Join Date: Dec 2002
Location: United States
Posts: 280
pcservicetech is an unknown quantity at this point
Thank you for your help.
I found that Windows Commander has built in support for creating tar archives, weather or not it does it 100% correctly I don't know.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:04 AM.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.