I have some 250 CSV source files in the incoming directory.
My task is to merge those CSV files and generate a file like Merge_
.
the Informatica Job will then pick the merge file as the source and work.
Now the merge part is taken care of. I want all the CSV files to be zipped and archived to another directory say /source/archive
as soon as the merge file is generated.
Also, I want the Merge_
file to remain like that and untouched.
I am aware of how to zip and tar separately but not sure how to combine both and move to some other directory.
I am trying to use something like this but it's not working:
tar -czvf All_Files.tar.gz *.csv /Source/Archive --remove-files --exclude Merge_file_1.csv, Merge_File_2.csv
Expecting it to tar and zip then move the file to /source/archive and remove the original files except the merge files
zip --outfile somewhere
ortar -cf somewhere
, wheresomewhere
is a full path that can be outside your workingdir. You couldtar --to-stdout
and redirect stdout where you need it. Or you could leave the zipping to tartar czf somewhere Merge_*
.