1 |
On Sat, 5 Feb 2011 18:05:05 meino.cramer@×××.de wrote: |
2 |
> Hi, |
3 |
> |
4 |
> I want to do the following as fast as possible and with less |
5 |
> system load as possible: |
6 |
> |
7 |
> There are two directories called 'source' and 'target'. |
8 |
> |
9 |
> 'source' gets updated via 'svn up', then it gets compiled. |
10 |
> Since there is no "make install" or similiar, installation |
11 |
> is done via copying 'source' to 'target'. A symlink from |
12 |
> /usr/local/bin/<name> to the compiled executabe in (now) |
13 |
> 'target' completes the installation. |
14 |
> |
15 |
> BUT: |
16 |
> 'source' is a VERY big directory and copying it to 'target' |
17 |
> after each svn up is a PAIN. |
18 |
> |
19 |
> Now I need a copy mechanism which does the following: |
20 |
> * copy all files with newer date to 'target' -- this can be done via |
21 |
> 'cp -u' |
22 |
> * copy all files which only exist in 'source' to 'target' -- |
23 |
> this can be done also with 'cp -u' |
24 |
> * BUT: Delete all files from 'target' which do not longer exist in |
25 |
> 'source' |
26 |
> |
27 |
> The last point gives me headaches. Scanning both directory after |
28 |
> 'cp -u' has done its job may take as long as a "blind copy" from |
29 |
> 'source' to 'target' after 'target' was initially removed. |
30 |
> |
31 |
> Is there any "lean method" to do what is described above ? |
32 |
> |
33 |
> Thank you very much for any help in advance! |
34 |
> Best regards, |
35 |
> mcc |
36 |
|
37 |
|
38 |
The tool you are looking for is 'rsync'. |
39 |
|
40 |
|
41 |
-- |
42 |
Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/~paulcol |
43 |
Before you criticize someone, you should walk a mile in their shoes. |
44 |
Then, when you do, you'll be a mile away, and you'll have their shoes. |