ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/scriptome/copy_to_prod.pl
Revision: 1.4
Committed: Mon Jan 15 03:45:31 2007 UTC (9 years, 5 months ago) by amirkarger
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -3 lines
Log Message:
Various tweaks.
Add image files to Makefile

Line File contents
1 #!perl -w
2
3 # Copy Scriptome website files to production
4 # TODO If no files are given, copy all of prod_dir to production
5
6 use strict;
7 use HTTP::Date; # convenient date string
8
9 my $Prod_Copy = 'prod_dir'; # dev website gets copied to here, then to prod
10 my $Web_Root = '\\\\cgrweb\sysbio\CSB\resources\computational\scriptome';
11 my $Web_Root_Parent = '\\\\cgrweb\sysbio\CSB\resources\computational';
12 my $Archive = 'Z:\projects\scriptome\toolbox\archive';
13
14 die "This script must run from Windows!\n" unless $^O eq "MSWin32";
15
16 if (@ARGV) {
17 die "Use backslashes in filenames!\n" if grep m#/#, @ARGV;
18 @ARGV = map {glob } @ARGV; # make sure we change *.html to single filenames
19 foreach my $i (@ARGV) {
20 # /y means don't ask
21 &do_it("copy /y $Prod_Copy\\$i $Web_Root\\$i");
22 }
23
24 } else { # copy the whole prod_dir
25 (my $dt = &HTTP::Date::time2iso(time)) =~ tr/ :-/_/d;
26 print "Date $dt\n";
27
28 # Make a copy, move it to an archive on titan
29 &do_it("xcopy /s $Web_Root $dt");
30 &do_it("move $dt $Archive");
31
32 # /e: recursive copy, /w: prompt before copying
33 &do_it("xcopy /e /w $Prod_Copy $Web_Root_Parent\\scriptome");
34 }
35
36 sub do_it { my $cmd = shift; print "$cmd\n"; system $cmd; }