LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to delete the destination files while the source files deleted in cp -u ? (https://www.linuxquestions.org/questions/linux-general-1/how-to-delete-the-destination-files-while-the-source-files-deleted-in-cp-u-96649/)

myunicom 09-25-2003 04:07 AM

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.

Nezzo 09-25-2003 07:27 AM

try cp -r

lyle_s 09-25-2003 11:44 PM

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

myunicom 09-26-2003 11:16 AM

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.

lyle_s 09-26-2003 01:13 PM

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 05:35 AM.