source: trunk/npemap.org.uk/scripts/tile-processing/upload.pl @ 408

Last change on this file since 408 was 408, checked in by Nick Burch, 14 years ago

Two new helper scripts

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/usr/bin/perl
2use strict;
3
4my $scale = shift @ARGV;
5my @args = @ARGV;
6
7unless($scale && $args[0]) {
8        print "Use:\n";
9        print "  upload.pl <scale> [easting] [easting] [easting....]\n";
10        print "\n";
11        print "Will upload the specified easting directories to all 3 servers\n";
12        exit 1;
13}
14unless($scale == 1 || $scale == 3 || $scale == 6) {
15        die("Scale must be the 1st argument, and one of 1, 3 or 6\n");
16}
17
18# Report what we're going to do
19print "About to upload ".join(" ",@args)." for scale $scale\n\n";
20
21# Path to the scale directory on each server
22my %servers;
23$servers{dev} = "/usr/local/OSGB/";
24$servers{encore} = "/usr/local/maps/OSGB/";
25$servers{urchin} = "/srv/www/tile.npemap.org.uk/html/";
26
27# Upload each in turn
28foreach my $server (reverse sort keys %servers) {
29        my $path = $servers{$server} . "scaled$scale/";
30
31        my $cmd = "rsync -avc ".join(" ",@args)." $server:$path";
32        print $cmd."\n";
33        print `$cmd`;
34}
35print "\n\n";
36
37# Fix permissions on urchin
38my $cmd = "ssh urchin 'cd $servers{urchin}scaled$scale/ && chown -R .npemap ".join(" ",@args)."'"; 
39print $cmd."\n";
40`$cmd`;
41
42# Done
43print "\n\n";
Note: See TracBrowser for help on using the repository browser.