File: runplots.sh

package info (click to toggle)
tuptime 5.2.5
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 416 kB
  • sloc: python: 1,951; sh: 545; makefile: 5
file content (47 lines) | stat: -rw-r--r-- 1,117 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash


# This script executes all the plots available at the same time
# with the same arguments.

# Defaults
PyEx='python3'
Size='22x10'
pDays='30'
EndDT=$(date +"%d-%m-%y")

while getopts s:p:e: flag; do
    case "${flag}" in
        s)
	  Size=$(grep -oP '\d+x\d+' <<< ${OPTARG})
	;;
        p)
	  pDays=$(grep -oP '\d+' <<< ${OPTARG})
	;;
        e)
	  EndDT=$(grep -oP '\d+-\w+-\d+' <<< ${OPTARG})
	;;
	*)
	  echo "ERROR: Invalid argument flag" && exit -1
	;;
    esac
done

# Set X and Y size
Xcm=$(cut -dx -f1 <<< $Size)
Ycm=$(cut -dx -f2 <<< $Size)	
XnY="-W $Xcm -H $Ycm"

echo "Execution: $0 [-s Width x Height] [ -p Past Days] [ -e End Date]"
echo "Example:   $0 -s 22x10 -p 30 -e 31-Dec-20"
echo ""

echo -e "Making 4 plots in background...\n"
echo -e "Wide x Height:\t ${Xcm}x${Ycm}"
echo -e "Past Days:\t ${pDays}"
echo -e "End Date:\t ${EndDT}\n"

$PyEx ./tuptime-plot1.py $XnY -e $EndDT -p $pDays > /dev/null &
$PyEx ./tuptime-plot1.py $XnY -e $EndDT -p $pDays -x > /dev/null &
$PyEx ./tuptime-plot2.py $XnY -e $EndDT -p $pDays > /dev/null &
$PyEx ./tuptime-plot2.py $XnY -e $EndDT -p $pDays -x