Skip to content

Instantly share code, notes, and snippets.

@wasdee
Created December 17, 2022 08:05
Show Gist options
  • Save wasdee/ec86761f949f67503ed3a6b5976621ba to your computer and use it in GitHub Desktop.
Save wasdee/ec86761f949f67503ed3a6b5976621ba to your computer and use it in GitHub Desktop.
add datetime bash and create top log
#!/usr/bin/env bash
now=$(date +"%Y_%m_%d-%H_%M_%S")
top -b -n 120 > "top-120iters-$now.txt"
# this takes 120 iterations of top, which is 120*3 seconds = 6 minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment