cp --update - Linux

This is a discussion on cp --update - Linux ; If I do: cp -R --preserve=timestamps /dir1 /dir2 and then do: cp -uR --preserve=timestamps /dir1 /dir2 The second command tries to copy files that have not been updated. The timestamps are the same. The only difference is the permissions. Is ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: cp --update

  1. cp --update

    If I do:

    cp -R --preserve=timestamps /dir1 /dir2

    and then do:

    cp -uR --preserve=timestamps /dir1 /dir2

    The second command tries to copy files that have not been updated. The
    timestamps are the same. The only difference is the permissions. Is
    this the reason cp thinks these files have changed? I want cp to
    ignore permissions and only look at the timestamp to determine if files
    need to be updated.

    Thanks for the help,
    Stephen


  2. Re: cp --update

    I hate it when people say "here's a better way!" but I in fact, do this all the
    time, but I use rsync. It's likely what you're looking for. If not, sorry,
    I've never used cp in this manner.

    stephen.r.gray@gmail.com wrote:
    > If I do:
    >
    > cp -R --preserve=timestamps /dir1 /dir2
    >
    > and then do:
    >
    > cp -uR --preserve=timestamps /dir1 /dir2
    >
    > The second command tries to copy files that have not been updated. The
    > timestamps are the same. The only difference is the permissions. Is
    > this the reason cp thinks these files have changed? I want cp to
    > ignore permissions and only look at the timestamp to determine if files
    > need to be updated.
    >
    > Thanks for the help,
    > Stephen
    >


+ Reply to Thread