Skip to main content
added 1 character in body
Source Link
DopeGhoti
  • 79.2k
  • 10
  • 107
  • 141
# presuming that the files are e. g. template-2017-07-01-16:

# To test a given date
for file in template-2017-07-01-{00..23}; do
  if ! [[ -f "$file" ]]; then
    echo "$file is missing"
  fi
done

# To test a given year
year=2017
for month in seq -w 1 12; do
    dim=$( cal $( date -d "$year-$month-01" "+%m %Y" | awk 'NF { days=NFdays=$NF} END {print days}' )
    for day in $(seq -w 1 $dim); do
        for file in template-${year}-${month}-${day}-{00..23}; do
           if ! [[ -f "$file" ]]; then
             echo "$file is missing"
           fi
        done
    done
done
# presuming that the files are e. g. template-2017-07-01-16:

# To test a given date
for file in template-2017-07-01-{00..23}; do
  if ! [[ -f "$file" ]]; then
    echo "$file is missing"
  fi
done

# To test a given year
year=2017
for month in seq -w 1 12; do
    dim=$( cal $( date -d "$year-$month-01" "+%m %Y" | awk 'NF { days=NF} END {print days}' )
    for day in $(seq -w 1 $dim); do
        for file in template-${year}-${month}-${day}-{00..23}; do
           if ! [[ -f "$file" ]]; then
             echo "$file is missing"
           fi
        done
    done
done
# presuming that the files are e. g. template-2017-07-01-16:

# To test a given date
for file in template-2017-07-01-{00..23}; do
  if ! [[ -f "$file" ]]; then
    echo "$file is missing"
  fi
done

# To test a given year
year=2017
for month in seq -w 1 12; do
    dim=$( cal $( date -d "$year-$month-01" "+%m %Y" | awk 'NF { days=$NF} END {print days}' )
    for day in $(seq -w 1 $dim); do
        for file in template-${year}-${month}-${day}-{00..23}; do
           if ! [[ -f "$file" ]]; then
             echo "$file is missing"
           fi
        done
    done
done
added 471 characters in body
Source Link
DopeGhoti
  • 79.2k
  • 10
  • 107
  • 141
# presuming that the files are e. g. template-2017-07-01-16: 

# To test a given date
for file in template-2017-07-01-{00..23}; do
  if ! [[ -f "$file" ]]; then
    echo "$file is missing"
  fi
done

# To test a given year
year=2017
for month in seq -w 1 12; do
    dim=$( cal $( date -d "$year-$month-01" "+%m %Y" | awk 'NF { days=NF} END {print days}' )
    for day in $(seq -w 1 $dim); do
        for file in template-${year}-${month}-${day}-{00..23}; do
           if ! [[ -f "$file" ]]; then
             echo "$file is missing"
           fi
        done
    done
done
# presuming that the files are e. g. template-2017-07-01-16:
for file in template-2017-07-01-{00..23}; do
  if ! [[ -f "$file" ]]; then
    echo "$file is missing"
  fi
done
# presuming that the files are e. g. template-2017-07-01-16: 

# To test a given date
for file in template-2017-07-01-{00..23}; do
  if ! [[ -f "$file" ]]; then
    echo "$file is missing"
  fi
done

# To test a given year
year=2017
for month in seq -w 1 12; do
    dim=$( cal $( date -d "$year-$month-01" "+%m %Y" | awk 'NF { days=NF} END {print days}' )
    for day in $(seq -w 1 $dim); do
        for file in template-${year}-${month}-${day}-{00..23}; do
           if ! [[ -f "$file" ]]; then
             echo "$file is missing"
           fi
        done
    done
done
Source Link
DopeGhoti
  • 79.2k
  • 10
  • 107
  • 141

# presuming that the files are e. g. template-2017-07-01-16:
for file in template-2017-07-01-{00..23}; do
  if ! [[ -f "$file" ]]; then
    echo "$file is missing"
  fi
done