Results 1 to 7 of 7
I have files in /src/ that I copied to /dst/
I encountered some I/O errors. All of the files from /src/ exist in /dst/, but they are not 100% exact ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-20-2010 #1Just Joined!
- Join Date
- Jul 2010
- Posts
- 3
copy file if file size differs
I have files in /src/ that I copied to /dst/
I encountered some I/O errors. All of the files from /src/ exist in /dst/, but they are not 100% exact copies. (some data is missing in the files in /dst/)
cp -u /src/ /dst/ only moves files from /src/ to /dst/ if A. the files does not exist in /dst/ or B. the file in /src/ is "newer" (involving time stamp) than the existing file in /dst/
How can I move all of the files (and directories containing files) from /src/ (recursively) to /dst/ if the file size of the file in /dst/ differs from the file in /src/?
- 07-21-2010 #2Linux Newbie
- Join Date
- Apr 2007
- Posts
- 119
Why not just recopy them regardless?
Other than that, I think you would need to make a script to compare sizes and then cp based on that. IIRC, there isn't a way to check size using "cp"
- 07-21-2010 #3Just Joined!
- Join Date
- Jul 2010
- Posts
- 3
- 07-21-2010 #4Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
You probably could use rsync.
- 07-21-2010 #5Linux Newbie
- Join Date
- Apr 2007
- Posts
- 119
- 07-21-2010 #6Just Joined!
- Join Date
- Jul 2010
- Posts
- 3
- 07-22-2010 #7Linux Newbie
- Join Date
- Apr 2007
- Posts
- 119


Reply With Quote

