Skip to content
Permalink
0708053cdf
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 43 lines (37 sloc) 1.47 KB
#! /usr/bin/perl
use strict;
use warnings;
use File::Find;
our $PROJECT_PATH = '/project/meissner_external_fastq/';
our $PROJECT_RAW_PATH = '/amd/furoncles/M/MG000/project/meissner_external_fastq';
chdir $PROJECT_RAW_PATH or die "$PROJECT_RAW_PATH: $!\n";
my @f1 = lstat $PROJECT_PATH or die "$PROJECT_PATH: $!\n";
my @f2 = lstat $PROJECT_RAW_PATH or die "$PROJECT_RAW_PATH: $!\n";
$f1[0] == $f2[0] && $f1[1] == $f2[1] or die "paths $PROJECT_PATH doeesn't match $PROJECT_RAW_PATH. Has the project been moved?\”";
my $twoweeksago = time - 2*7*24*60*60;
print "twoweeksago:",scalar(localtime($twoweeksago)),"\n";
my $done = 0;
for my $folder (<RUN_*>) {
-d $folder or next;
-e "$folder/$folder.is-archived-on-tape.log" and next;
my $mtime = 0;
find (
sub {
my @f = lstat $_ or die "$File::Find::name: $!\n";
$f[9] > $mtime and $mtime = $f[9];
$f[10] > $mtime and $mtime = $f[10];
},
$folder
);
print "mtime of folder $folder is ",scalar(localtime($mtime)),"\n";
if ($mtime < $twoweeksago) {
system "/project/admin/tools/archiver.pl", $folder and exit 1;
rename "$folder.is-archived-on-tape.log", "$folder/$folder.is-archived-on-tape.log"
or die "rename $folder.is-archived-on-tape.log to $folder/$folder.is-archived-on-tape.log: $!\n";
$done++;
if ($done >= 2) {
print "limit of max 2 archives per day reached\n";
exit;
}
}
}