Operating System - HP-UX
1821802 Members
3423 Online
109637 Solutions
New Discussion юеВ

fback and gzip in one command

 
ASH_27
Valued Contributor

fback and gzip in one command

Hi

I want to backup my configuration directories and gzip it and stored it on to another partition. Can you please let me know the one command which will do fabackup and pipe that to execute gzip.

example
backup data from /home/test/ folder and gzip the file and then

and store backuped file on to /dailybackup/ folder

Thanks
Ashish
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: fback and gzip in one command

Shalom Ashish,

I do not think that fbackup will support gzipping all files as it goes. I would recommend a two step process.

gzip the configuration files to a location you have selected and then call fbackup command line after the files are zipped.

You can try something:

fbackup | gzip

or

gzip < fbackup

The results may be explosive or unreliable.

Suggested code:

tar cvf /dailybackup/config.tar
gzip /dailybackup/config.tar
fbackup

fbackup likes going to tape.

Sorry, three steps.

:-(

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeff_Traigle
Honored Contributor

Re: fback and gzip in one command

You should be able to do this pretty easily...

fbackup -f - -i /home/test | gzip > /daily/backup/home-test.fb.gz

As with compress, if no file is specified or - is specified, stdin is compressed to stdout so the redirection is required to save the compressed data to a file.
--
Jeff Traigle
OldSchool
Honored Contributor

Re: fback and gzip in one command

Also, you might want to look into GNU's tar, which supports gzipping files "on the fly"

Dave La Mar
Honored Contributor

Re: fback and gzip in one command

Ashish -

Can you -
for i in `ls /home/test/folder`
do
cat $i | gzip > /dailybackup/$i.gz
done

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Muthukumar_5
Honored Contributor

Re: fback and gzip in one command

Can you exaplain this:

After taking backup with fbackup then piping to gzip to make gunzipped file. Then do you want to save that gunzipped file or unzipping that file and extract the files to /dailybackup/ directory?

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: fback and gzip in one command

Why don't you do simply as,

# tar -cvf /dailybackup/backup.tar /home/test
# gunzip /dailybackup/backup.tar

You will have backup file as,

dailybackup/backup.tar.gz

--
Muthu
Easy to suggest when don't know about the problem!