Skip to content

Instantly share code, notes, and snippets.

@adililhan
Created September 26, 2023 21:31
Show Gist options
  • Save adililhan/f068ffc4cf2321293b59ccb77c0c78d6 to your computer and use it in GitHub Desktop.
Save adililhan/f068ffc4cf2321293b59ccb77c0c78d6 to your computer and use it in GitHub Desktop.
#!/bin/bash
trap control_t SIGTERM
function control_t() {
echo "SIGTERM detected"
echo "... Disk cleanup started ..."
sleep 45
echo "... Disk cleanup is complete ..."
exit 0
}
for i in `seq 1 86400`; do
sleep 1
date
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment