You are not logged in.

#1 2010-01-30 20:29:47

virati
Member
Registered: 2008-04-14
Posts: 83

[Solved] - Simple CP update for new files only?

I'm backing up my harddrive to my backup external drive (which is where I got the files from in the first place). cp --update is copying EVERYTHING all over again just because the modify times are different (by one day because of how I transferred files to my backup in the first place).

Is there a simple/elegant solution to only copying files that don't exist at the target directory? ie. an --update but without the copying of 'newer' versions of old files?

Last edited by virati (2010-01-30 20:37:38)

Offline

#2 2010-01-30 20:31:48

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [Solved] - Simple CP update for new files only?

virati wrote:

I'm backing up my harddrive to my backup external drive (which is where I got the files from in the first place). cp --update is copying EVERYTHING all over again just because the modify times are different (by one day because of how I transferred files to my backup in the first place).

Is there a simple/elegant solution to only copying files that don't exist at the target directory? ie. an --update but without the copying of 'newer' versions of old files?

cp --no-clobber

Offline

#3 2010-01-30 20:37:58

virati
Member
Registered: 2008-04-14
Posts: 83

Re: [Solved] - Simple CP update for new files only?

itsbrad212 wrote:
virati wrote:

I'm backing up my harddrive to my backup external drive (which is where I got the files from in the first place). cp --update is copying EVERYTHING all over again just because the modify times are different (by one day because of how I transferred files to my backup in the first place).

Is there a simple/elegant solution to only copying files that don't exist at the target directory? ie. an --update but without the copying of 'newer' versions of old files?

cp --no-clobber

gah! I looked through the cp --help 3 times and can't believe i looked over that each time. Thanks!

Offline

#4 2010-01-30 20:38:02

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [Solved] - Simple CP update for new files only?

I'm glad it worked big_smile

Offline

#5 2010-01-31 03:40:08

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [Solved] - Simple CP update for new files only?

rsync is wayyyyy better for backups

rsync -av --delete $SRC/ $TARGET

Offline

Board footer

Powered by FluxBB