Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dateien kopieren, aber nur wenn ziel vorhanden
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Fri Jul 04, 2003 4:28 pm    Post subject: Dateien kopieren, aber nur wenn ziel vorhanden Reply with quote

Ich würde gern eine Verzeichnisstruktur, sagen wir mal /A nach /B, rekursiv(!) kopieren. Dabei möchte ich aber nur die Dateien kopieren die es in B schon gibt. Ich weis es gibt bei cp die option --update, aber in meinem Falls kann es durchaus sein dass die Quelldatei älter ist als die Zieldatei und dennoch kopiert werden soll.

Ihr wißt doch bestimmt ne Lösung... :-)
Back to top
View user's profile Send private message
compu-tom
Guru
Guru


Joined: 09 Jan 2003
Posts: 415
Location: Berlin, Germany

PostPosted: Fri Jul 04, 2003 7:21 pm    Post subject: Reply with quote

Vielleicht hilft ja rsync mit der Option --existing?
Back to top
View user's profile Send private message
Kampi
n00b
n00b


Joined: 05 Apr 2003
Posts: 20
Location: Vienna, Austria, Europe

PostPosted: Fri Jul 04, 2003 7:34 pm    Post subject: Reply with quote

hab das nicht getestet, aber ich würds so probieren:
Code:

find /B -name "*" -exec cp /A/{} /B \;

find listet bei mir so nur dateien und keine dirs, aber wenn ich dein problem richtig verstanden hab, dann ist das eh genau das, was du brauchst...
Back to top
View user's profile Send private message
SuperGrobie
n00b
n00b


Joined: 24 May 2003
Posts: 11
Location: Dresden/Germany

PostPosted: Fri Jul 04, 2003 7:40 pm    Post subject: Reply with quote

Code:

cd $dirA
find . > /tmp/.list
cd $dirB
cp `cat /tmp/.list` $dirA

Würde ich vorschlagen.
_________________
"I'm sorry, I can't hear you - there's a banana in my ear!"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum