Created
June 17, 2020 12:41
-
-
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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