Tuesday, January 5, 2010

Tar and Gzip

Create a Tar ball and gzip on the fly.
BACKUPFILE=FileName"_"`date '+%m%d%Y'`.tar.gz
tar cvf - /SourceDir | gzip -c > /directoryForGzipTarBall/$BACKUPFILE

Or we can use the -z option of the tar command to use gzip to compress the tar file.
tar -zcvf backup.tar.gz /u01/app/oracle/sourecedirectory

******************************************
keywords: tar gzip
******************************************
rdbms version: N/A
******************************************

No comments: