-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkill.sh
More file actions
executable file
·34 lines (28 loc) · 890 Bytes
/
kill.sh
File metadata and controls
executable file
·34 lines (28 loc) · 890 Bytes
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
#!/bin/bash
#
# PICO Kill All Jobs Script
# Kills all running processes and resets status table
#
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
SERVERS=("rggpur00" "rggpur01" "rggpur02" "rggpur03" "rggpur04" "rggpur05" "rggpur06" "rggpur07")
STATUS_FILE="$SCRIPT_DIR/pico_status.txt"
echo "Killing all processes on all servers..."
# Kill ALL processes on all servers
for server in "${SERVERS[@]}"; do
echo "Killing all processes on $server..."
ssh "$server" "pkill -9 -u gnsmdev" 2>/dev/null || true
done
echo "Resetting status table..."
# Reset status table
cat > "$STATUS_FILE" << EOF
Server svfits fits_to_ms phaseshift imaging weight
rggpur00 0 0 0 0 0
rggpur01 0 0 0 0 0
rggpur02 0 0 0 0 0
rggpur03 0 0 0 0 0
rggpur04 0 0 0 0 0
rggpur05 0 0 0 0 0
rggpur06 0 0 0 0 0
rggpur07 0 0 0 0 0
EOF
echo "All processes killed and status table reset."