Quote:
Originally Posted by Turbocapitalist
I would make a shell script which uses stat to find the sizes of the two files, compare the results, and then copy if the one is larger. For that you'll probably need command substitution, depending on how you approach it.
You posted two links which almost do that in #5 above. Please say what is wrong with the second link, I mean in addition to it parsing of ls output.
|
Yep; if the OP bothered to put in the search term I gave them, and read the resulting first link, it would have given them this:
Code:
for x in $(ls -1 home/me/local/folder/*)
do
eachsize=$(stat -c "%s")
rsync -avz --progress --max-size=${eachsize} remote:/home/you/folder/${x} .
done
...which does EXACTLY what they're after. Pretty clear the OP put no effort into finding/modifying/writing their own solution.