darshan-mk-log-dirs.pl.in 833 Bytes
Newer Older
1
#!/usr/bin/perl -w
2 3 4 5 6
#
#  (C) 2009 by Argonne National Laboratory.
#      See COPYRIGHT in top-level directory.
#

7 8
use File::Basename;

9 10
# creates a hierarchy of subdirectories for darshan to place log files in
# LOGDIR/<year>/<month>/<day>/
11 12 13 14 15 16 17

# use log dir specified at configure time
$LOGDIR = "@__CP_LOG_PATH@";


my $year = (localtime)[5] + 1900;
my $month;
18
my $day;
19 20
my $i;
my $j;
21
my $k;
22 23 24

umask(0);

25 26
# go through the end of next year
for ($i=$year; $i<($year+2); $i++)
27
{
28
    mkdir("$LOGDIR/$i", 0755) or die("Error: could not mkdir $LOGDIR/$i.\n");
29 30
    for ($j=1; $j<13; $j++)
    {
31 32
        mkdir("$LOGDIR/$i/$j", 0755) or die("Error: could not mkdir $LOGDIR/$i/$j.\n");
        for ($k=1; $k<32; $k++)
33
        {
34
            mkdir("$LOGDIR/$i/$j/$k", 01777) or die("Error: could not mkdir $LOGDIR/$i/$j/$k.\n");
35

36
        }
37 38 39
    }
}

40