You are not logged in.

#1 2010-01-25 01:43:48

M177ER
Member
Registered: 2008-06-15
Posts: 148

[solved] copy directory skipping existing files??

I am trying to copy a large number files ~4000 from my hard drive to an external one. The files all exist in one folder and many subfolders. I want to do this from a terminal and I want to skip any files that already exist on the external hard drive. Is this the correct way to do it (ie. using the update -u option)?

cp -R -u ~/folder /media/hdd2/folder

Last edited by M177ER (2010-01-25 02:33:51)

Offline

#2 2010-01-25 01:50:33

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,390
Website

Re: [solved] copy directory skipping existing files??

       -n, --no-clobber
              do  not  overwrite  an  existing  file  (overrides a previous -i
              option)

-u will overwrite the existing files if your source files are newer.  Not sure if you want that...

Offline

#3 2010-01-25 01:55:21

M177ER
Member
Registered: 2008-06-15
Posts: 148

Re: [solved] copy directory skipping existing files??

Thanks Allan. I am trying to recover the files from a failed hard drive. I copied the files from the failed hard drive to my laptop and am now trying to get them onto my external hard drive. I had to cancel it half way through the write process when Thunar locked up and the computer became unresponsive. The files being copied have not been modified but I will use the -n option as this seems to be more like what I want (the skip option in Thunar).

Offline

Board footer

Powered by FluxBB