Changeset 1683 in ProjectBuilder
- Timestamp:
- Jan 3, 2013, 5:02:53 AM (12 years ago)
- Location:
- projects/casparbuster/devel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
projects/casparbuster/devel/bin/cb
r1682 r1683 350 350 351 351 my $tar = Archive::Tar->new; 352 $tar->setcwd($tdir);353 352 my $curdate = time(); 354 353 foreach my $k (keys %{$cbp}) { … … 357 356 foreach my $o ((keys %{$cbp->{$k}->{$type}})) { 358 357 if ((defined $force) || (not defined $cbp->{$k}->{$type}->{$o}->{'deleted'})) { 359 $tar->add_files("$o"); 358 if ( -r "$tdir/$o" ) { 359 pb_log(1,"INFO: Adding to the tar file $tdir/$o\n"); 360 chdir($tdir); 361 $tar->add_files("$o"); 362 } else { 363 # It's in the common place instead 364 foreach my $c (keys $cb->{'commondir'}) { 365 if (-r "$dest/$c/$o") { 366 pb_log(1,"INFO: Adding to the tar file $dest/$c/$o\n"); 367 chdir("$dest/$c"); 368 $tar->add_files("$o"); 369 } 370 } 371 } 360 372 # Add an entry to the DB 361 373 if (defined $dbid->{$o}) { … … 397 409 $ssh2 = cb_ssh_init($remote,$mach,$debug); 398 410 399 $ssh2->scp_put($tarfile,$tarfile); 411 if (!($ssh2->scp_put($tarfile,$tarfile))) { 412 my @error = $ssh2->error(); 413 print "@error\n"; 414 confess "Unable to copy tar file $tarfile to $mach\n"; 415 } 400 416 pb_log(0,"INFO: Copying content under $ENV{'PBTMP'} on $remote\@$mach\n"); 401 417 … … 404 420 if ((defined $cb->{'commondir'}) && (defined $cb->{'commondir'}->{$machine})) { 405 421 $path = $cb->{'webdir'}->{$machine}; 406 $tbextract = $cb->{'commondir'}->{$machine};422 #$tbextract = $cb->{'commondir'}->{$machine}; 407 423 } 408 424 $chan = $ssh2->channel(); … … 410 426 411 427 if (not $debug) { 428 # Reminder: sudo should be configured for this account as Defaults !requiretty for this to work 412 429 print $chan "sudo tar -C $path -x -f $tarfile $tbextract\n"; 413 430 pb_log(0,"WARNING: $_\n") while (<$chan>); … … 440 457 if (defined $cbp->{$k}->{'reloadscript'}) { 441 458 if (not $debug) { 442 print $chan " $cbp->{$k}->{'reloadscript'}\n";459 print $chan "sudo $cbp->{$k}->{'reloadscript'}\n"; 443 460 } 444 pb_log(0,"INFO: Executing (on $mach) $cbp->{$k}->{'reloadscript'}\n"); 445 } 461 pb_log(0,"INFO: Executing (on $mach) $cbp->{$k}->{'reloadscript'} as root\n"); 462 } 463 } 464 465 pb_log(0,"INFO: Executing (on $mach) /usr/local/bin/mk$mach if present as root\n"); 466 if (not $debug) { 467 # Using Net::SSH2 here was not working (due to the shell ?) 468 pb_system("ssh $remote\@$mach \"sudo /usr/local/bin/mk$mach\"","WAIT: Executing (on $mach) /usr/local/bin/mk$mach if present as root","verbose"); 446 469 } 447 470 … … 450 473 print $chan "rm -rf $ENV{'PBTMP'}\n"; 451 474 } else { 452 pb_log(1," Remove remote directory $ENV{'PBTMP'} on $mach\n");475 pb_log(1,"INFO: Please remove remote directory $ENV{'PBTMP'} on $mach\n"); 453 476 } 454 477 $chan->close(); -
projects/casparbuster/devel/lib/CasparBuster/SSH.pm
r1667 r1683 63 63 pb_log(3,"DEBUG: New SSH2 object created\n"); 64 64 $ssh2->debug(1) if ($debug > 2); 65 pb_log(3,"DEBUG: SSH2 debug mode on\n") ;65 pb_log(3,"DEBUG: SSH2 debug mode on\n") if ($debug > 2); 66 66 67 67 $ssh2->connect($machine) || confess "Unable to connect to $remote\@$machine: $!"; … … 77 77 78 78 $chan->exec("mkdir -p $ENV{'PBTMP'}"); 79 pb_log( 3,"DEBUG: Created $ENV{'PBTMP'} on $remote\@$machine\n");79 pb_log(1,"DEBUG: Created $ENV{'PBTMP'} on $remote\@$machine\n"); 80 80 $chan->close; 81 81
Note:
See TracChangeset
for help on using the changeset viewer.