Ignore:
Timestamp:
2013-06-18T20:37:31+12:00 (11 years ago)
Author:
ak19
Message:

Delete the upload_dir and recreate it before moving the generated reports into here and uploading to puka. The diffcol cronjob will run on the main machine now, not the vm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nightly-tasks/diffcol/trunk/task.pl

    r27656 r27657  
    502502
    503503sub upload {
    504     # ensure the upload directory exists before trying to transfer the xml and html files across
    505     # if it already existed, clear it of contents
    506     if (! -d $ENV{'UPLOAD_DIR'}) {
    507     &File::Path::make_path($ENV{'UPLOAD_DIR'});
    508     } # else rm $UPLOAD_DIR/*   
     504    # if the upload dir already existed, clear it of contents
     505    if (-d $ENV{'UPLOAD_DIR'}) { #else rm $UPLOAD_DIR/*
     506    # don't want to keep previous days reports
     507    # else we will have to manually clear them at some point
     508    # just generate the set of reports for this run of task.pl upload
     509    # and
     510    &File::Path::remove_tree($ENV{'UPLOAD_DIR'});
     511    }
     512    # recreate the upload directory   
     513    &File::Path::make_path($ENV{'UPLOAD_DIR'});
    509514
    510515    # copy all *.xml and *.html files across to UPLOAD_DIR
     
    531536    $ENV{'IDENTITY_FILE'} = "$ENV{'IDENTITY_DIR'}${sep}upload-" . $ENV{'SNAPSHOT_MODE'} . ($^O eq "MSWin32" ? ".ppk" : "");
    532537    if(-f $ENV{'IDENTITY_FILE'}) {
    533     my $command = "cd \"$ENV{'UPLOAD_DIR'}\" && tar -c *.html | "; #&& cat *.html | "; # && tar -c * |
     538    # the report we want to upload is actually just report-$dateid.html
     539    my $command = "cd \"$ENV{'UPLOAD_DIR'}\" && tar -c *.html | "; #&& cat *.html | "; # && tar -c * |
    534540    $command .= ($^O eq "MSWin32" ? "plink" : "ssh");
    535541    $command .= " -T -i \"$ENV{'IDENTITY_FILE'}\" nzdl\@puka.cs.waikato.ac.nz";
Note: See TracChangeset for help on using the changeset viewer.