![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copy and compress | here2learn | UNIX for Dummies Questions & Answers | 5 | 03-08-2009 01:10 PM |
| combining mv and compress command | sam_78_nyc | Shell Programming and Scripting | 4 | 11-06-2007 03:45 PM |
| Compress command | indira | UNIX for Dummies Questions & Answers | 5 | 08-20-2007 02:04 PM |
| Compress and copy a Folder | scorpiyanz | UNIX for Advanced & Expert Users | 1 | 08-19-2005 01:53 PM |
| Help on compress command | rahulrathod | SCO | 1 | 09-28-2004 04:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
Copy Compress as one command
Hi,
I need to copy and compress files in a directory in single line of command. I am able to copy and gzip files in one command but not directory. Command that I am using for copying directory is below : cp -rp /u01/app/<directory> /u01/app/backup |gzip -r /u01/app/backup/<directory> Thanks, Prakash |
|
||||
|
I used below code as suggested by Porter for compressing and copying directory.
find ${COPY_DIR} -type f | while read N do mkdir -p "${BACKUP_DIR}/`dirname $N`" gzip < $N > ${BACKUP_DIR}/$N.gz done However I have some directories which have space in name. I get below error when copying and compressing directories which have sapce in name. /backup/sidora/iAS/ifs1.1/doc/Quick Tour/Graphics/rtarr.gif.gz: cannot create Any ideas on how can I take fix above error. Thanks in advance. |
|
||||
|
Thanks for update matrixmadhan. Even though after making suggsted changes I still get same error message. Now my code looks like :
find ${COPY_DIR} -type f | while read N do mkdir -p "${BACKUP_DIR}/`dirname $N`" gzip < "$N" > "${BACKUP_DIR}/$N.gz" done Error message /backup/sidora/iAS/ifs1.1/doc/Quick Tour/Graphics/rtarr.gif.gz: cannot create |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|