TAR and file permissions

Clovertech Forums Read Only Archives Cloverleaf Operating Systems TAR and file permissions

  • Creator
    Topic
  • #51603
    Roy Osumi
    Participant

      I am trying to tar up a couple of sites using AIX 5.2.  I am using tar -cvf tarname.tar directory/ etc.  when I untar (tar -xvf tarname.tar) my file permissions on my target are not the same as my source.  How can I get an exact copy of my source?

    Viewing 4 reply threads
    • Author
      Replies
      • #70934
        David Barr
        Participant

          Code:

          tar -xvfp

          Read the fine manual for a description of the -p flag.

        • #70935
          Roy Osumi
          Participant

            I tried it “tar -xvfp main_022410.tar” in AIX 5.2 I get a error message:

            tar: Cannot open p: No such file or directory

            AIX doesn’t seem to like the p function modifier.

            I thought if I untarred as root I should get the original owners and permissions.  This was not the case for the majority of the files.  Owners were good the rights were not.  Most were  only rw-r-r where I was expecting rw-rw-r.  I even had issues with directory rights.

          • #70936
            David Barr
            Participant

              You might want to check which tar executable you’re running.  For some reason Cloverleaf ships with it’s own copy of tar, and the OS should also have one installed.  The version of tar with our install (QDX 5.5, HPUX) supports the -p option.

            • #70937
              Chris Williams
              Participant

                When using the -f option for the standard version of tar the next thing on the command line must be the file name. That’s why it’s reporting it can’t find the file “p”.  You should always make -f the last of multiple options unless you’re reading/writing to the tape drive.

              • #70938
                Roy Osumi
                Participant

                  Yep that did the trick.  tar -xvpf filename  Awesome.  Thanks to both David and Chris for your help.

              Viewing 4 reply threads
              • The forum ‘Operating Systems’ is closed to new topics and replies.