Skip to content

Instantly share code, notes, and snippets.

@stephenturner
Created November 16, 2010 22:01
Show Gist options
  • Save stephenturner/702607 to your computer and use it in GitHub Desktop.
Save stephenturner/702607 to your computer and use it in GitHub Desktop.
submit_ibd_pbs.pl
#!/usr/bin/perl
use strict;
if(scalar(@ARGV) != 1){
print "submit_ibd_pbs.pl <num_pbs_to_submit>\n";
exit;
}
my $LIMIT = $ARGV[0];
my $count = 0;
open(LOG, ">>submit_ibd_pbs.log") || die "Cannot open log to append to \n";
print LOG localtime() . "\n";
foreach(glob("submitme*.pbs")){
my $file = $_;
my $out = `qsub $file`;
`mv $file submitted.$file`;
print LOG $out;
$count += 1;
if($count >= $LIMIT){
last;
}
}
print LOG "\n";
close(LOG);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment