darshan-mk-log-dirs.pl.in 840 Bytes
Newer Older
1
#!/usr/bin/perl -w
2
#
Shane Snyder's avatar
Shane Snyder committed
3 4
# Copyright (C) 2015 University of Chicago.
# See COPYRIGHT notice in top-level directory.
5 6
#

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

# use log dir specified at configure time
13
$LOGDIR = "@__DARSHAN_LOG_PATH@";
14 15 16 17


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