Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

Copying GWC Directory efficiently– Linux

Posted by smathermather on September 20, 2011

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 Responses to “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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: