Skip to content

Instantly share code, notes, and snippets.

View aszulinski's full-sized avatar

Adam Szuliński aszulinski

View GitHub Profile
@aszulinski
aszulinski / check_rds_status_remotely.sh
Created December 1, 2022 11:31
Check RDS stopping finished from your Linux/MacOS using "say" command
#!/bin/bash
# run in loop from command line: while sleep 60; do sh check_rds_status.sh; done
status=$(aws rds describe-db-instances --query 'DBInstances[].DBInstanceStatus[]' | grep stopping)
if [[ "$status" != *"stopping"* ]]; then
printf "RDS stopped\n"
say "RDS stopped"
fi
@aszulinski
aszulinski / check_process_is_running_remotely.sh
Last active December 1, 2022 13:12
Check remote process completion/finished from your Linux/MacOS using "say" command
#!/bin/bash
# run in a loop from command line: while sleep 60; do sh check_process_is_running.sh; done
status=$(ssh IP_ADDRESS_HERE -t "ps aux | grep PROCESS_NAME_HERE | grep -v \"color\|grep\"")
if [[ "$status" != *"PROCESS_NAME_HERE"* ]]; then
printf "Process finished\n"
say "Process finished"
fi