summaryrefslogtreecommitdiffstats
path: root/corer
blob: d80b9a332f4854dc27bac49d77f38c498b7aa037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/zsh


args="[email protected]"
RHOME="/home/raghavendra"

params=(${(ws|:|)args})

CORE_DIR="/home/raghavendra/Arch/cores"
LOGF="$RHOME/logs/cores.log"
temp=($CORE_DIR/*)

if [[ $#temp > 20 ]];then 
    echo "No core  file for now. Space isn't infinite" >>| $LOGF
    exit
else
    >| $CORE_DIR/$args.core
fi
echo "
===================================================================
Time $(date -d @$params[1]):

          File $params[2]
    with  PID  $params[3]
and killed by  $params[4]
Moved into  ~/Arch/cores/$args.core 
==============================================================
"
>>| $LOGF
chown  raghavendra:users $CORE_DIR/$args.core