You are not logged in.

#1 2009-08-17 02:58:56

Intrepid
Member
Registered: 2008-06-11
Posts: 254

[SOLVED] Using cp to copy files without overwriting anything

as far as I can tell, none of the file managers can do this.  it's either all or nothing.  I can also do cp -Ri to recursively copy a directory and choose which files to overwrite.  However, I'm talking about thousands of songs I'm copying to an SD card.  overwriting is NOT an option due to flash wearing.  How should I make it so I can copy every new song without overwriting the old ones?

Last edited by Intrepid (2009-08-17 03:39:31)


Intrepid (adj.): Resolutely courageous; fearless.

Offline

#2 2009-08-17 03:06:01

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] Using cp to copy files without overwriting anything

From the cp man page:

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

You should also consider using (g)rsync for this.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2009-08-17 03:39:19

Intrepid
Member
Registered: 2008-06-11
Posts: 254

Re: [SOLVED] Using cp to copy files without overwriting anything

Thanks for the recommendation and help big_smile


Intrepid (adj.): Resolutely courageous; fearless.

Offline

Board footer

Powered by FluxBB