Skip to content

Instantly share code, notes, and snippets.

@GuyPaddock
Created June 17, 2020 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GuyPaddock/406add20ee4aefd54a94230432554f8e to your computer and use it in GitHub Desktop.
Save GuyPaddock/406add20ee4aefd54a94230432554f8e to your computer and use it in GitHub Desktop.
Keeping a long-running command going without interruption through kubectl exec through timeouts
# This trick keeps the kubectl session active by printing the current time every 10 seconds
#
# Run commands like this
(while true; do sleep 10; date; done) & <YOUR LONG RUNNING COMMAND GOES HERE>
# For example:
(while true; do sleep 10; date; done) & sha512sum my_super_large_file.dat | tee checksum.sha512
# When done, to get control back, run this command:
fg
# Then press CTRL+C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment