Gentoo Archives: gentoo-user

From: meino.cramer@×××.de
To: Gentoo <gentoo-user@l.g.o>
Subject: [gentoo-user] OT: Copy directories in a special manner
Date: Sat, 05 Feb 2011 07:06:56
Message-Id: 20110205070505.GA6318@solfire
1 Hi,
2
3 I want to do the following as fast as possible and with less
4 system load as possible:
5
6 There are two directories called 'source' and 'target'.
7
8 'source' gets updated via 'svn up', then it gets compiled.
9 Since there is no "make install" or similiar, installation
10 is done via copying 'source' to 'target'. A symlink from
11 /usr/local/bin/<name> to the compiled executabe in (now)
12 'target' completes the installation.
13
14 BUT:
15 'source' is a VERY big directory and copying it to 'target'
16 after each svn up is a PAIN.
17
18 Now I need a copy mechanism which does the following:
19 * copy all files with newer date to 'target' -- this can be done via
20 'cp -u'
21 * copy all files which only exist in 'source' to 'target' --
22 this can be done also with 'cp -u'
23 * BUT: Delete all files from 'target' which do not longer exist in
24 'source'
25
26 The last point gives me headaches. Scanning both directory after
27 'cp -u' has done its job may take as long as a "blind copy" from
28 'source' to 'target' after 'target' was initially removed.
29
30 Is there any "lean method" to do what is described above ?
31
32 Thank you very much for any help in advance!
33 Best regards,
34 mcc

Replies

Subject Author
Re: [gentoo-user] OT: Copy directories in a special manner Paul Colquhoun <paulcol@×××××××××××××××××.au>
[gentoo-user] Re: OT: Copy directories in a special manner Nikos Chantziaras <realnc@×××××.de>
Re: [gentoo-user] OT: Copy directories in a special manner Neil Bothwick <neil@××××××××××.uk>