On Sat, 5 Feb 2011 18:05:05 meino.cra...@gmx.de wrote: > Hi, > > I want to do the following as fast as possible and with less > system load as possible: > > There are two directories called 'source' and 'target'. > > 'source' gets updated via 'svn up', then it gets compiled. > Since there is no "make install" or similiar, installation > is done via copying 'source' to 'target'. A symlink from > /usr/local/bin/<name> to the compiled executabe in (now) > 'target' completes the installation. > > BUT: > 'source' is a VERY big directory and copying it to 'target' > after each svn up is a PAIN. > > Now I need a copy mechanism which does the following: > * copy all files with newer date to 'target' -- this can be done via > 'cp -u' > * copy all files which only exist in 'source' to 'target' -- > this can be done also with 'cp -u' > * BUT: Delete all files from 'target' which do not longer exist in > 'source' > > The last point gives me headaches. Scanning both directory after > 'cp -u' has done its job may take as long as a "blind copy" from > 'source' to 'target' after 'target' was initially removed. > > Is there any "lean method" to do what is described above ? > > Thank you very much for any help in advance! > Best regards, > mcc
The tool you are looking for is 'rsync'. -- Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/~paulcol Before you criticize someone, you should walk a mile in their shoes. Then, when you do, you'll be a mile away, and you'll have their shoes.