Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Copying a Directory Structure to a new structure Post 79340 by vino on Wednesday 27th of July 2005 06:11:57 AM
Old 07-27-2005
tar cvf - `find /dir1 -name '*.dbf'` > dir1.tar

So you are saying this doesnt work at all, i.e. it doesnt duplicate the directory structure ??

vino
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

2. Shell Programming and Scripting

Need help in Directory Structure

I have writen the following code to show the dirctory structure. Can any body help me for using the recursive function in this code? echo "-(0)" echo "$HOME-(1)" cd ~ set * for i in `ls $HOME` do if then echo ".....${i}" cd... (5 Replies)
Discussion started by: murtaza
5 Replies

3. UNIX for Dummies Questions & Answers

Copying with directory structure

Hi, I need to copy a set of directories along with all sub directories and files from one unix box to another. Any ideas? cnfsed (4 Replies)
Discussion started by: Cnfsed
4 Replies

4. Shell Programming and Scripting

redirection and copying with same directory structure

Dear Experts, How can I solve this problem ? I want to redirect with having the same directory structure as in my input. for temp in `find ./CSV/ -name "*.v"` do fname = `basename $temp` ./script.sh $temp > ./out/$fname done But my problem here is all the... (3 Replies)
Discussion started by: user_prady
3 Replies

5. Programming

Search attributes in one structure using the values from another structure

Hello Groups I am trying to find out ways of comparing a value from a 'c' structure to a value in another 'C' structure. the 'C' structure can be a List or liked list as it contains lot many records. if we loop it in both the structures it is going to consume time. I am looking for a simple... (3 Replies)
Discussion started by: dhanamurthy
3 Replies

6. Shell Programming and Scripting

Copying a directory structure with the latest versions of files

Hello I have three directory structures for code releases. Each directory structure looks like this: bash-3.00$ ls -R | more .: Test_Release_1 Test_Release_2 Test_Release_3 ./Test_Release_1/dbcode: rp_online_import_srdp.pkb-1 srdp_ar_validation.pkb-1... (1 Reply)
Discussion started by: Glyn_Mo
1 Replies

7. UNIX for Dummies Questions & Answers

Help with copying specific parts of a file structure

Hello. I need help with copying part of a file structure to another directory while still keeping the structure. For example look below: ../folder1/sub1/txt.txt ../folder1/sub2/pic.png ../folder2/sub1/pic.png ../folder2/sub2/txt.txt So in this I would like to copy only the directories and... (3 Replies)
Discussion started by: the
3 Replies

8. Shell Programming and Scripting

Copying files to new dir structure.

I am trying to figure out a way to script copying specific files from one dir structure to another. I have a dir structure like this: dira/author 1/book 1/file a.epub /book 2/file b.epub /author 2/book 1/file c.epub /author 3/book 1/file d.epub /book 2/file... (2 Replies)
Discussion started by: arcanas
2 Replies

9. UNIX for Dummies Questions & Answers

copying the dir/subdir structure from one server to another?

Hi All, I want to copy the dir/subdir structure from SERVER-A to SERVER-B without copying all the files in each dir. Is it possible using SCP / SFTP command? For example, SERVER-A has following two dir/subdirectories and files under each subdir. ... (1 Reply)
Discussion started by: Hangman2
1 Replies

10. Shell Programming and Scripting

Copying files from various folders to similar folder structure in another location

Hi, I need to write a script the has to copy the files from folders and subfolders to the same folder structure located in another location. Ex: mainfolder1 file1,file2,file3 subfolder1(file1,etc) subfolder2(file1,etc) to another folder location of same folder structure. rsync is not... (7 Replies)
Discussion started by: Raji Perumal
7 Replies
P7ZIP(1)						      General Commands Manual							  P7ZIP(1)

NAME
7-Zip - A file archiver with highest compression ratio SYNOPSIS
7za [adeltux] [-] [SWITCH] <ARCHIVE_NAME> <ARGUMENTS>... DESCRIPTION
7-Zip is a file archiver with the highest compression ratio. The program supports 7z (that implements LZMA compression algorithm), ZIP, CAB, ARJ, GZIP, BZIP2, TAR, CPIO, RPM and DEB formats. Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format. 7za is a stand-alone executable. 7za handles less archive formats than 7z, but does not need any others. FUNCTION LETTERS
a Add d Delete e Extract l List t Test u Update x eXtract with full paths SWITCHES
-ai[r[-|0]]{@listfile|!wildcard} Include archives -ax[r[-|0]]{@listfile|!wildcard} eXclude archives -bd Disable percentage indicator -i[r[-|0]]{@listfile|!wildcard} Include filenames -l don't store symlinks; store the files/directories they point to (CAUTION : the scanning stage can never end because of recursive symlinks like 'ln -s .. ldir') -m{Parameters} Set Compression Method -mhe=on|off 7z format only : enables or disables archive header encryption (Default : off) -o{Directory} Set Output directory -p{Password} Set Password -r[-|0] Recurse subdirectories (CAUTION: this flag does not do what you think, avoid using it) -sfx[{name}] Create SFX archive -si Read data from StdIn (eg: tar cf - directory | 7za a -si directory.tar.7z) -so Write data to StdOut (eg: 7za x -so directory.tar.7z | tar xf -) -slt Sets technical mode for l (list) command -t{Type} Type of archive (7z, zip, gzip, bzip2 or tar. 7z format is default) -v{Size}[b|k|m|g] Create volumes -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName] Update options -w[path] Set Working directory -x[r[-|0]]]{@listfile|!wildcard} Exclude filenames -y Assume Yes on all queries DIAGNOSTICS
7-Zip returns the following exit codes: 0 Normal (no errors or warnings detected) 1 Warning (Non fatal error(s)). For example, some files cannot be read during compressing. So they were not compressed 2 Fatal error 7 Bad command line parameters 8 Not enough memory for operation 255 User stopped the process with control-C (or similar) Backup and limitations DO NOT USE the 7-zip format for backup purpose on Linux/Unix because : - 7-zip does not store the owner/group of the file. On Linux/Unix, in order to backup directories you must use tar : - to backup a directory : tar cf - directory | 7za a -si directory.tar.7z - to restore your backup : 7za x -so directory.tar.7z | tar xf - If you want to send files and directories (not the owner of file) to others Unix/MacOS/Windows users, you can use the 7-zip format. example : 7za a directory.7z directory Do not use "-r" because this flag does not do what you think. Do not use directory/* because of ".*" files (example : "directory/*" does not match "directory/.profile") EXAMPLE 1 7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z dir1 adds all files from directory "dir1" to archive archive.7z using "ultra settings" -t7z 7z archive -m0=lzma lzma method -mx=9 level of compression = 9 (Ultra) -mfb=64 number of fast bytes for LZMA = 64 -md=32m dictionary size = 32 megabytes -ms=on solid archive = on EXAMPLE 2 7za a -sfx archive.exe dir1 add all files from directory "dir1" to SFX archive archive.exe (Remark : SFX archive MUST end with ".exe") EXAMPLE 3 7za a -mhe=on -pmy_password archive.7z a_directory add all files from directory "a_directory" to the archive "archive.7z" (with data and header archive encryption on) SEE ALSO
7z(1) 7zr(1) HTMLHelp({DEST_SHARE_DOC}/MANUAL/index.htm) AUTHOR
Written for Debian by Mohammed Adnene Trojette. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWp7zip | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for p7zip is available on http://opensolaris.org. Mohammed Adnene Trojette September 1 2006 P7ZIP(1)
All times are GMT -4. The time now is 10:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy