develog

[bash] del-log.sh 본문

OS & Shell/bash

[bash] del-log.sh

냐옴 2021. 3. 2. 14:41

del-log.sh

#!/bin/bash
logdir=~/logs
type=(access error)
list=(
    $(date '+%Y%m%d' --date '1 days ago')
    $(date '+%Y%m%d' --date '2 days ago')
)
for t in ${type[@]}; do
    for d in ${list[@]}; do
        file=$(echo ${logdir}/${f}_${d}.log)
        echo $file
    done
done
Comments