Copying GWC Directory efficiently– Linux

There has been discussion recently amongst some of the web cache builders of switching from file-based tile caching to SQLite or other database driven systems.  I haven’t kept close tabs– perhaps this is already implemented for some.  For GeoWebCache, we’re working with files (lots of them), so copying efficiently if we need to move our cache is important.  The tar command helps here, e.g. (run in GWC cache directory)

 tar cf - * | ( cd /path-to-target-dir/; tar xfp -) 

 

2 thoughts on “Copying GWC Directory efficiently– Linux

  1. Ooh that’s old-school. Why not use rsync? Then if the copy breaks half-way through you don’t have to start it all over again. I’m not sure your tar solution is even any better than “cp -a”.

    Something like:

    rsync -av src/ dest/

  2. Oh, tar is far better than any version of cp as far as speed is concerned. I haven’t done a side by side test with rsync, but rsync does have the resumability factor going for it, you’re right. In this case I’m working with dedicated drive mounts on a dedicated virtual switch on a single physical machine, so no worries about losing the connection partway through.

    I was thinking about just using dd :).

Leave a reply to smathermather Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.