Sponsored Content
Top Forums Shell Programming and Scripting Massive Copy With Base Directory Post 302676447 by alister on Tuesday 24th of July 2012 03:08:37 PM
Old 07-24-2012
I would expect a simple, single invocation of pax to be preferable to that shell script.

Quote:
Originally Posted by nitrobass24
Ideally this would work on Solaris, HP-UX and Redhat.
Of pax, cpio, and tar, pax is the only utility that is standardized by POSIX. So if your hope is that a single command runs identically on each of those operating systems, pax seems a good choice.

Regards,
Alister
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find command to run only in the base directory

Hi. I'm trying to get my find command to only search in the directory i tell it to, but i don't want it to search in the sub directories as well... For example, i have a /data/files/ and /data/files/old I want to search for all .sav files within /data/files but i don't want it to drill... (4 Replies)
Discussion started by: Stephan
4 Replies

2. Solaris

Missing Base Directory

Hey all, I'm attempting to migrate a zone from one system to another, but I noticed that on the new system ssl BASEDIR was missing. I was wondering if creating the directory path for this would fix the issue when I migrate files over. SSL is installed on the new system but does not show a... (1 Reply)
Discussion started by: em23
1 Replies

3. Shell Programming and Scripting

Copy Last modified directory to another directory

Hi, I have to copy last modified Directory to another directory.How can i Do using pipe or redirect cp -R 'ls -lrt|tail -1' test is not working. please help. (3 Replies)
Discussion started by: shaveta
3 Replies

4. Shell Programming and Scripting

Base directory of the package

Hello, I have an RPM package for which I need to know the base directory /opt/appdir. But if the package is relocated, then it will be different. I need to get the value dynamically. I tried to query the RPM with INSTPREFIXES but couldn't get the value. The only way I see is to do 'rpm -ql RPM... (2 Replies)
Discussion started by: chiru_h
2 Replies

5. Shell Programming and Scripting

how to copy the directory but not copy certain file

Hi experts cp bin root src /mnt but not copy bin/bigfile any help? ( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum) Thanks (6 Replies)
Discussion started by: yanglei_fage
6 Replies

6. Shell Programming and Scripting

Copy the files in directory and sub folders as it is to another directory.

How to copy files from one directory to another directory with the subfolders copied. If i have folder1/sub1/sub2/* it needs to copy files to folder2/sub1/sub2/*. I do not want to create sub folders in folder2. Can copy command create them automatically? I tried cp -a and cp -R but did... (4 Replies)
Discussion started by: santosh2626
4 Replies

7. Shell Programming and Scripting

Copy same name data from other file base on column

HI I have input file A.txt X Y Z File B.txt 1 X 10 AAA 11123 2 Y 22 PlD 4563 3 Z 55 PlD 54645 4 Z 66 PlD 15698 5 F 44 PlD 154798 6 C 55 PlD 12554 7 Z 88 PlD 23265 8 C 99 PlD 151654 9 C 11 PlD 21546546 I need New File C.txt (1 Reply)
Discussion started by: pareshkp
1 Replies

8. Shell Programming and Scripting

Delete directory on date base

Hi, I have below directories Direct 2013-08-12 23123 Direct 2013-08-13 24121 Direct 2013-08-14 34513 Direct 2013-08-31 15435 ........... Direct 2013-09-12 53145 Direct 2013-09-30 65234 Direct 2013-09-30 89642 (11 Replies)
Discussion started by: learnbash
11 Replies

9. Shell Programming and Scripting

Massive ftp

friends good morning FTP works perfect but I have a doubt if I want to transport 10 files, I imagine that I should not open 10 connections as I can transfer more than 1 file? ftp -n <<!EOF open caburga user ephfact ephfact cd /users/efactura/docONE/entrada bin mput EPH`date... (16 Replies)
Discussion started by: tricampeon81
16 Replies
tar(4)							     Kernel Interfaces Manual							    tar(4)

NAME
tar, pax - Archive file format DESCRIPTION
The cpio, pax, and tar commands dump several files into one, in a medium suitable for transportation. This file is often referred to as a tar file, or tar tape, since it was originally designed to be on an archive tape. An archive file is a series of blocks, with each block of size TBLOCK. A file on the archive is represented by a header block which describes the file, followed by zero or more blocks which give the contents of the file. At the end of the tape are two blocks filled with binary zeros, as an end-of-file indicator. The blocks are grouped for physical I/O operations. Each group of n blocks (where n is set by the b keyletter on the tar command line, with a default of 20 blocks) is written with a single system call. On nine-track tapes, the result of this write is a single tape record. The last group is always written at the full size, so blocks after the two zero blocks contain random data. On reading, the specified or default group size is used for the first read, but if that read returns less than a full tape block, the reduced block size is used for further reads. The header block looks like: ------------------------------------- Field Name Offset Length ------------------------------------- name 0 100 mode 100 8 uid 108 8 gid 116 8 size 124 12 mtime 136 12 chksum 148 8 typeflag 156 1 linkname 157 100 magic 257 6 version 263 2 uname 265 32 gname 297 32 devmajor 329 8 devminor 337 8 prefix 345 155 ------------------------------------- The name field is the name of the file, as specified on the command line. Files dumped because they were in a directory that was named on the command line have the directory name as prefix and /filename as suffix. The mode field is the file mode, with the top bit masked off. The uid and gid fields are the user id and group id numbers that own the file. The size field is the size of the file in bytes. Links and symbolic links are dumped with this field specified as zero. The mtime field is the modification time of the file at the time it was dumped. The chksum field is an octal ASCII value which represents the sum of all the bytes in the header block. When calculating the checksum, the chksum field is treated as if it were all blanks. The typeflag field identifies the type of data following the header. Valid values are: A Global Extended Header follows. An Extended Header follows. Archive data follows. The Global Extended Header and Extended Header formats are only produced when the tar command is used with the -E option, or the pax com- mand is used with the -x xtar option. The linkname field is the name of the file that this file is linked to, if any. If this field is empty, the file is not linked. The first time a given i-node number is dumped, it is dumped as a regular file. Subsequently, it is dumped as a link instead. Upon retrieval, if a link entry is retrieved but the file it was linked to is not, an error message is printed and the tape must be rescanned manually to retrieve the file that it is linked to. The magic field is the magic number for the file type as described in the magic(4) reference page. The version field is always 00 (zero-zero). The uname and gname fields are the user name and group names that own the file. The devmajor and devminor fields are the device major and minor numbers as described in the mknod(8) reference page. The name, linkname, and prefix fields are null-terminated strings, except when all characters in the field are non-null characters. The typeflag field is a single character. The other fields are zero-filled octal numbers in ASCII format terminated by a null character. Unused fields of the header are binary zeros (and are included in the checksum). NOTES
The encoding of the header is designed to be portable across platforms. If filenames are chosen that use characters not in the portable filename character set, results are unpredictable. EXAMPLES
The layout of an archive with a Global Extended Header, two data files, and the end of archive is shown here. ----------------------------------- ustar Header (typeflag=g) Global Extended Header Data ----------------------------------- ustar Header (typeflag=x) Extended Header Data ustar Header (typeflag=0) Data for File 1 ----------------------------------- ustar Header (typeflag=0) Data for File 2 ----------------------------------- ustar Header (typeflag=0) Data for File n ----------------------------------- Block of binary zeroes ----------------------------------- Block of binary zeroes ----------------------------------- RELATED INFORMATION
Commands: cpio(1), mknod(8), pax(1), tar(1) Files: magic(4) delim off tar(4)
All times are GMT -4. The time now is 06:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy