use Time::Local; #figures out the current date in YYYYMMDD format ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time); $year = $year + 1900; $mon = $mon + 1; if (length($mday) < 2){ $mday = "0$mday"; } if (length($mon) < 2){ $mon = "0$mon"; } my $today = "$year$mon$mday";
use Time::Local
my @tm = localtime(); $tm[4] += 1; $tm[5] += 1900; my $today = sprintf("%d%02d%02d", reverse(@tm[3..5]));
@htmlfiles
use File::Find;my @htmlfiles;...find(\&name_files, @directories);sub name_files{ push(@htmlfiles, $File::Find::name) if ($File::Find::name =~ m|\.html?$|i);}
iwjobc -i
chomp(my $jobid = `$iwhome/bin/iwjobc -i $wft`);chomp(my $taskid = `$iwhome/bin/iwgettaskbyname $jobid YOURSTARTTASK`);my @submit_file;# assume that $avpath got defined somewhere as the arevpath to a specific# workarea - or that you are looping through a list of workareas when# performing the following tests ...# Further, assume that $avpath is using platform-specific path separators# (e.g. '\' on Windows)foreach my $e (@expiredfiles){ $e =~ tr|/|\\| if ($^O eq "MSWin32"); my $iwsf = `$iwhome/bin/iwgetfilejobs $avpath$e` push(@submit_file, "$e") if ($iwsf !~ /job=/s);}if (@submit_file){ my $e_idx = 0; my $m_idx = scalar(@submit_file); while ($e_idx < $m_idx){ my $s_idx = $e_idx; my $len = 0; while($e_idx < $m_idx && ($len + length($submit_file[$e_idx])) < 200){ $len += length($submit_file[$e_idx]); $e_idx++; } $e_idx--; `$iwhome/bin/iwaddtaskfile $taskid "@submit_file[$s_idx..$e_idx]" "expired files"`; $e_idx++; }}
iwlistmod