Page 1 of 1

Compress and Archive a file

Posted: Wed Sep 26, 2007 7:56 am
by rajkraj
Hi,

I have a requirement where i after the Job is run successfully ,I have to compress the file and Archive it.
Right now i am just using a Execute command stage to Archive the file by using mv #Path#/file1.txt #ArchivePath#/file1.'date +"%Y%m%d"`.txt
without compressing it.
How can i compress the file and archive it with a date stamp.

Thanks in advance.

Posted: Wed Sep 26, 2007 7:59 am
by Maveric
try gzip FilePath/test.txt > FilePath/test.gz. Should work not sure though.

Posted: Wed Sep 26, 2007 8:15 am
by chulett
Yes, you'll need to write a script to do this properly and to have the proper levels of error checking. For archiving multiple files at once, consider a 'tar ball' - a tar archive that is then compressed. And for compression, you've got 'compress' that should always be there on UNIX plus optional tools like zip or gzip.

Check with your SA if you're not sure what options you have.