#!/bin/bash
# Days and Procs declaration
DAYS="3"
PROCS="dyyno"
# 3 days Old date
AGO=$(date --date="$DAYS days ago" +"%b %d")
# Getting pids
PIDS=$(ps eaxo bsdstart,cmd,pid | egrep "^$AGO"' | egrep "$PROCS" | awk '{ print $4}')
# killing the processes
echo "Killing $PROCS process created $AGO days ago"
kill -9 $PIDS
here i wanted to take the log file associated with the running process (dyyno process) and pass a parameter "0"
Can anyone help me pls@@
Thnxxx in advance