LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hoe to copy without overwriting (https://www.linuxquestions.org/questions/linux-newbie-8/hoe-to-copy-without-overwriting-836310/)

abdoullah 10-05-2010 08:13 AM

Hoe to copy without overwriting
 
Hi Guys,
I looked in the man cp pages to find an option that allows me to copy files without overwriting and without having to answer no every time prompted (huge number of files) but i didn't find any, can you guys help me out here?

druuna 10-05-2010 08:26 AM

Hi,

Doesn't the -u option do what you want?

Quote:

-u, --update
copy only when the SOURCE file is newer than the destination file or when destination file is missing.
Hope this helps.

abdoullah 10-05-2010 08:46 AM

Quote:

Originally Posted by druuna (Post 4118314)
Hi,

Doesn't the -u option do what you want?



Hope this helps.

yes this helps, thanks a lot, this solve half of my issue though, cause my source files are newer than destination ones and even though i don't want new files to replace old files if exist already. what i'll do is i'll change time stamp before copying.
Thanks once more!!

druuna 10-05-2010 08:51 AM

You're welcome :)

BTW: Can you put the SOLVED tag on this thread (first post, the Thread Tools pull down menu).

raviteja_s 10-05-2010 12:23 PM

rsync -rHhlAp

abdoullah 10-05-2010 02:26 PM

Quote:

Originally Posted by raviteja_s (Post 4118518)
rsync -rHhlAp

thanks! this also does the same.


All times are GMT -5. The time now is 04:29 AM.