Hi,
you could do something like:
1. get a listing of filename-filesize filepath for each drive, sorted by filename-filesize
2. do a diff of the first column from each file to see whats in drive1 thats not in drive2
3. and grep these filename-filesizes from the drive2contents to pick out the full paths that you'll then need to copy across to drive1
or:
Code:
find drive1 -type f -print0 | du -b --files0-from=- | sed -r 's#^(.*)\t(.*)/([^/]+)$#\3-\1\t\2/\3#' | sort > drive1contents
find drive2 -type f -print0 | du -b --files0-from=- | sed -r 's#^(.*)\t(.*)/([^/]+)$#\3-\1\t\2/\3#' | sort > drive2contents
diff <(cut -f 1 drive1contents) <(cut -f1 drive2contents) | grep "^>" | cut -c3- | grep --file=- drive2contents | cut -f 2
the output from the last command should be the paths to the files on drive2 that you'll need to copy to drive1 to make drive1 the superset of both.
Bookmarks