check for matching files when comparing directories
hi,
I am making a shell script to back up one directory to another, how could i compare directories and inform myself if there are any matching files that will be over written |
i've not tried it really, but i'd suggest that you might just want somethign as simple as "cp -uv" this will only overwrite old files, and presumably the verbose output will easily tell you which ones are over written. unless you require some sort of verification before it happens...
|
I think you would want to use the 'diff' command. Check out the man pages for its uses. If you are just using the 'cp' command then you can add the -i switch to be prompted before overwriting files. I'm not sure if thats what your looking for though.
|
thanks the cp -i works great
|
All times are GMT -5. The time now is 06:46 AM. |