cpio, tar - time travel? - Suse

This is a discussion on cpio, tar - time travel? - Suse ; I have to do a backup of selected files; I could not get the desired result just using find and tar; I therefore tried to revert to cpio as an alternative to tar. With some quite unexpected results. Consider the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: cpio, tar - time travel?

  1. cpio, tar - time travel?

    I have to do a backup of selected files; I could not get the desired result
    just using find and tar; I therefore tried to revert to cpio as an
    alternative to tar. With some quite unexpected results.

    Consider the following:

    ~> ls -la tips
    -rw-r--r-- 1 sutterp sopac 10953 2006-01-01 16:07 tips

    ~> tar cfv Test.tar tips
    tips

    ~> tar tfv Test.tar
    -rw-r--r-- sutterp/sopac 10953 2006-01-01 16:07:17 tips

    Now create the same tar archive, but this time using cpio.

    ~> rm Test.tar

    ~> echo tips | cpio -o -F Test.tar --format tar
    25 blocks


    Now lets have a look at the archive

    ~> tar tfv Test.tar
    -rw-r--r-- 500/500 10953 1971-12-24 02:30:13 tips

    We are now far in the past.

    Question 1: Why?

    Question 2: How to do I do it better?

    Thanks

    Peter

  2. Re: cpio, tar - time travel?

    sutterp wrote:

    > I have to do a backup of selected files; I could not get the desired
    > result just using find and tar; I therefore tried to revert to cpio as an
    > alternative to tar. With some quite unexpected results.
    >
    > Consider the following:
    >
    > ~> ls -la tips
    > -rw-r--r-- 1 sutterp sopac 10953 2006-01-01 16:07 tips
    >
    > ~> tar cfv Test.tar tips
    > tips
    >
    > ~> tar tfv Test.tar
    > -rw-r--r-- sutterp/sopac 10953 2006-01-01 16:07:17 tips
    >
    > Now create the same tar archive, but this time using cpio.
    >
    > ~> rm Test.tar
    >
    > ~> echo tips | cpio -o -F Test.tar --format tar
    > 25 blocks
    >
    >
    > Now lets have a look at the archive
    >
    > ~> tar tfv Test.tar
    > -rw-r--r-- 500/500 10953 1971-12-24 02:30:13 tips
    >
    > We are now far in the past.
    >
    > Question 1: Why?
    >
    > Question 2: How to do I do it better?
    >
    > Thanks
    >
    > Peter


    What happens if you use this switch with your cpio call:

    --preserve-modification-time


  3. Re: cpio, tar - time travel?

    Michael Soibelman wrote:

    > sutterp wrote:
    >
    >> I have to do a backup of selected files; I could not get the desired
    >> result just using find and tar; I therefore tried to revert to cpio as an
    >> alternative to tar. With some quite unexpected results.
    >>
    >> Consider the following:
    >>
    >> ~> ls -la tips
    >> -rw-r--r-- 1 sutterp sopac 10953 2006-01-01 16:07 tips
    >>
    >> ~> tar cfv Test.tar tips
    >> tips
    >>
    >> ~> tar tfv Test.tar
    >> -rw-r--r-- sutterp/sopac 10953 2006-01-01 16:07:17 tips
    >>
    >> Now create the same tar archive, but this time using cpio.
    >>
    >> ~> rm Test.tar
    >>
    >> ~> echo tips | cpio -o -F Test.tar --format tar
    >> 25 blocks
    >>
    >>
    >> Now lets have a look at the archive
    >>
    >> ~> tar tfv Test.tar
    >> -rw-r--r-- 500/500 10953 1971-12-24 02:30:13 tips
    >>
    >> We are now far in the past.
    >>
    >> Question 1: Why?
    >>
    >> Question 2: How to do I do it better?
    >>
    >> Thanks
    >>
    >> Peter

    >
    > What happens if you use this switch with your cpio call:
    >
    > --preserve-modification-time


    Thanks,
    Well, it does not accept --preserve-modification-time (nor -m) in mode o, it
    allows it only in mode i and p, but then its too late.
    ~> cpio --version
    GNU cpio version 2.5
    running on SuSE Linux V9.2

    and its not only the date, but also UID and GID of the files which is wrong!







+ Reply to Thread