11/02 I have a bunch of directories with files (and other directories)
in them. I have a mirrored copy that contains many of the same
files, but with different dates. Is there an easy way (short of
writing s/w to check each file against the other) to do something
like : If date on mirror < 10/31, then sync date with other dir?
I don't think rsync can help with this. I just need the dates
changed, not the contents of the files. Changing the contents
could actually be bad.
\_ Why would you want to do this? (Curious, and it might help to come
up with a better solution)
\_ Does one line of perl count as "writing s/w"?
\_ find; grab time stamp; stamp matching file
\_ The catch is that a checksum needs to be done at some point.
Obviously, you could add a step to checksum in there, too. I was
just wondering if there's a utility to do this. Essentially,
I want rsync, but to have rsync only change dates and not
contents. If you read the rsync man page, you will see that
rsync has a lot more options than find for deciding when to
do what.
\_ What role does the checksum play in this? Are you trying to
do something more than set the timestamp on /mirror/file to
the timestamp on /primary/file if the timestamp on/mirror/file
is more than N days old, or something more complicated?
\_ If you're really too lazy to write something trivial in perl,
you could use rsync with the -n option to find the relevant
files, and pipe that to xargs/foreach. -tom
\_ I broke down and did this. It was not too bad. Thanks. |