1 |
On 12/15/18 4:33 PM, Jack wrote: |
2 |
> Is there any way to fix this other than completely repeating the copy? |
3 |
|
4 |
I'm sure there are other ways, but the first things that comes to mind |
5 |
is touch. Or rather a script that uses touch, and possibly find or a |
6 |
recursive glob. The idea being to have the list of files in (either of) |
7 |
the directories and touch the new copy with the old copy as the date & |
8 |
timestamp reference. |
9 |
|
10 |
touch --reference=${OldPath}/${CurrentFile} ${NewPath}/${CurrentFile} |
11 |
|
12 |
I'd probably cd to the new copy's path and do the recursive find / glob |
13 |
there to get the file name in a variable. I think that would apply more |
14 |
of the directory traversal walk I/O on the new path and just reference |
15 |
the full path to files in the old path. |
16 |
|
17 |
Quick testing (of globing, namely "**/*") in Zsh makes me think that the |
18 |
following would come close. |
19 |
|
20 |
OldPath="/mnt/old" |
21 |
NewPath="/mnt/new" |
22 |
cd $NewPath |
23 |
for CurrentFile in **/*; do |
24 |
touch --reference=${OldPath}/${NewPath} ${NewPath}/${CurrentFile} |
25 |
done |
26 |
|
27 |
> Will some version of rsync do what I want? |
28 |
|
29 |
Maybe ~> probably. |
30 |
|
31 |
> Thanks for any suggestions, other than to think more carefully before |
32 |
> typing. |
33 |
|
34 |
Mistakes happen. Once you realize how to recover from something, you |
35 |
become less scared of doing it. Save for your time to actually do the |
36 |
recovery. |