2

I took a backup using: cd /usr/CCS

tar cvfz /usr/LARGE/BKUP/hms.tar.gz *

Now I would like to restore HMS and overwrite at /usr/CCS/HMS.

HMS is one of the subfolders under /usr/CCS

Can I get some help in restoring only the HMS folder from the tar and overwriting it at /usr/CCS/HMS.

1 Answer 1

4

You could try this: tar -xvf /usr/LARGE/BKUP/hms.tar.gz -C /usr/CCS HMS

/usr/LARGE/BKUP/hms.tar.gz - is your backup

-C /usr/CCS - where tar should enter, to start extracting

HMS - which files/directorys it should extract from backup (path relative to archived files)

3
  • Thanks, which directory should I cd first.will this work in redhat.
    – Muhammad
    Apr 27, 2014 at 14:30
  • Directory is irrelevant. -C tells tar where to cd Apr 27, 2014 at 14:32
  • Worked perfectly. Thank you very much Artur.
    – Muhammad
    Apr 27, 2014 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .