updated killswitch

This commit is contained in:
Marc Mance
2024-04-30 15:55:37 -04:00
parent 33e32e118e
commit 8860809dfc
2 changed files with 2 additions and 13 deletions

View File

@@ -6,21 +6,12 @@ greeting="Running perfcollect for $minutes minutes"
echo "$greeting"
echo "Will auto upload to iXsystem when completed."
echo "Airgapped Systems will need to exfiltrate /root/*.csv"
echo ""
python3 ./collect.zpool.iostat.py --minutes $minutes &
start_time=$(date +%s) # Get start time in seconds since epoch
duration=$(($1/60)) # Set duration in seconds (here: 5 minutes)
echo "running gstat"
gstat -C -s -d -o -p -I 60s > /root/gstat.csv & # Run the command in the background
while [[ $(($(date +%s) - $start_time)) -lt $duration ]]; do
sleep 1
done
echo "killing gstat"
pkill gstat
timeout "$minutes"m gstat -C -s -d -o -p -I 60s > /root/gstat.csv &
cp /root/zpool_iostat.csv /root/gstat.csv /var/log