ZIP files using Execute command stage
Moderators: chulett, rschirm, roy
ZIP files using Execute command stage
I have a job sequence, that has a series of jobs to write to set of files and then one execute command stage to zip them up (in LInux) with this command
zip -r #TgtFileLoc#/Files.zip #TgtFileLoc#/*
And then another notification activity to read this zip file and email it as an attachment. All of this works and i am able to receive the email with the zip file.
but issue is that when i try to look at the contents of the zip file, it has the complete folder structure of the #TgtFileLoc# - instead of it having just the different files. How to avoid this?
Thanks in advance for your suggestions.
zip -r #TgtFileLoc#/Files.zip #TgtFileLoc#/*
And then another notification activity to read this zip file and email it as an attachment. All of this works and i am able to receive the email with the zip file.
but issue is that when i try to look at the contents of the zip file, it has the complete folder structure of the #TgtFileLoc# - instead of it having just the different files. How to avoid this?
Thanks in advance for your suggestions.
Balu,
the reason i need ZIP is coz these are csv files that i have generated on LInux, but need to email them to users who will open them in windows.
The zipped file when extracted looks good, i can open it fine in windows. The only issue what i am having here is that when i try to extract the zip file i am seeing the entire path
For eg: if the Target file location was
/folder1/folder2/Zipfile.zip, then when i extract, it extracts the same way
with all that folder structure - which is what i do not want.
the reason i need ZIP is coz these are csv files that i have generated on LInux, but need to email them to users who will open them in windows.
The zipped file when extracted looks good, i can open it fine in windows. The only issue what i am having here is that when i try to extract the zip file i am seeing the entire path
For eg: if the Target file location was
/folder1/folder2/Zipfile.zip, then when i extract, it extracts the same way
with all that folder structure - which is what i do not want.
Damn, not what I thought you meant. You need to 'cd' to the directory first and then do a relative zip if you don't want to store the full path. That or deselect the option to use the full path when unzipping. Do a "zip -help" from the command line and see if other options exist for this.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
If you don't specify a full path, it will write the output to the "current working directory", which for any job is the Project it is running from as you've found. To 'cd' first:
Code: Select all
cd #TgtLoc# && zip -j ZipFile.zip *
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers