Hi ,
I want to zip files present in the directories listed under a parent directory without zipping the directory itself
my parent directory path is
/informatica/DGDMN/PowerCenter1011/server/infa_shared/SrcFiles/OTE/Final_Directory
I have the below directories named as 1,2,3,4,5 listed under the parent directory "Final_Directory"
I want to zip the contents of each of these five directories separately and create 5 separate zipped files in such a way that the directory itself does not get zipped
The code that I used to create 5 zipped files is below. But it creates 5 zipped files along with zipping their folders (1,2,3,4,5).How should I modify this script to create zipped files only for the contents of each of these folders separately without zipping their actual folders?
Hi ,
I want to zip files present in the directories listed under a parent directory without zipping the directory itself
You haven't told us which OS you are using:
Notice, that some versions of the find-command do not allow for multiple instances of the {}-macro and because i do not know which one you are using you will have to find out if yours does or doesn't. In the latter case put the zip-command into a small script to which you pass the {} as argument and call that from the find-command.
This will safely change into & out of the directories you are working with and create a .tar for each on in the main directory (the big huge path you list) or you could direct them to a specific location if that is better for you.
Posting "Does not work" without explanation does not help you or anyone. If a command does not work for you, please show the exact circumstances you used it, and the exact error or malfunction you received. Do not paraphrase errors, or post the text as links, images, or attachments if you can avoid it: Paste the exact message, in code tags, like [code] text [/code] or by selecting the text and using the button.
Telling us "it is not working" will NOT help either you or us. Our respected forum members(MODs-->rbatte1, bakunin) already tried to help you without knowing much information about your system. I would like to request you please let us know all the details about your system eg--> O.S, sample Input_file in code tags more clearly and expected sample output more clearly in code tags along with all the conditions which you want to keep in solution. So that we could try to help and could try to learn/guide on same.
Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
Hi Folks,
I have logs at the following location
cd /out/app/logs/
now that logs directory contain different types of logs now sometimes i need to
do disk clean up activity so i need to zipped the logs can you please advise
any command by which all the logs created in this directory are... (2 Replies)
Hi Folks,
I have a directory in unix that is /usr/local/pos contain the folowing directoreis ..that is
dir1
dir2
dir3
now I want to delete only dir2 please advise how to remove the directory dir 2 ..that is rm command and how to use it , and second if I want to zip the dir3 please... (1 Reply)
Hi folks,
I have an query that is let say i have to search in an xml file an tag that is <abcdef> now this xml file is at /opt/usr/local so one fastest way to achieve this is go to this location by cd /opt/usr/local and then do grep like this... grep -i abcdef but for this I must know the... (4 Replies)
Hello everyone,
I am trying to make a script in KSH that will zip an entire directory but leave out one file in that directory. I then need to send that zipped directory to another UNIX box. I am new to UNIX and would appreciate a good template to study from. (3 Replies)
I have a folder, and in this folder, there are about 197 folders.
Resources
a
files and folders
b
files and folders
Like that. I need to make a zip with files and folders in them with the name the same as the parent folder. so.
a.zip
files and folders
b.zip
files and... (4 Replies)
Hi,
I am having some problem with a shell script which zip some files. For zipping I have used the following command:
find . -name "Test_*" -mtime 0 | zip Test_$(date +"%Y%m%d") -@
I have kept the script in /home/abc directory. It is creating the zip file within the same directory where i... (2 Replies)
Hiya,
I've been plugging away at this script and I cant get it to behave as I need.
first off it fails to adhere to the conditions of the file limit, and zips the directory regardless of the file count and secondly, but less important it zips up the entire path not just the directory I'm... (2 Replies)
Hi,
i have more than 300 tar files in directory and i want to zip all tar files to single file.
could anybody tell me the command since i know how to do zip for single tar file:
bash-3.00$gzip 2008_11_10.tar
bash-3.00$ pwd
/oracle1/archivebackup
in this directory i have lot files... (2 Replies)
Hello all,
I have files at /var/dir1/dir2/fil1.log etc.,.
dir2 is symlinked to /export/xxx/dir3
I am trying to monitor the disk space of the mount where these log files are present.
How do I determine dynamically the actual directory of the log files and corresponding mount when I use df... (3 Replies)