How to delete the destination files while the source files deleted in cp -u ?
I use cp -u to back up DirA to DirB every day. DirA files are changed every day( created or deleted). I find that when DirA files creatd the cp command can back up the newly created files into DirB, but can not delete the DirB corresponding files while it was deleted in DirA. Any Ideas ?
thanks. |
try cp -r
|
I'm don't think cp will delete files like you want it to. rsync was made for the job you're doing, and it can.
Lyle |
Thanks for lyle_s's help.
Can you tell me if the rsync command has max filesize limitation( like cpio max filesize 2G)? thanks again. |
You're welcome!
No, I don't see anything in man rsync about excluding files based on their size, just by name. So, if the files you don't want rsync'd have paths/names conforming to some pattern, you may be able to use that. I'd imagine you could combine find and rsync to do what you want. Lyle |
All times are GMT -5. The time now is 08:41 PM. |