Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active August 9, 2016 13:38
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 kurozumi/2fe11cc6f95e1fb5048eb331d1c2eb2d to your computer and use it in GitHub Desktop.
Save kurozumi/2fe11cc6f95e1fb5048eb331d1c2eb2d to your computer and use it in GitHub Desktop.
【MySQL】定期的にテーブルの行数を保存する
#!/bin/bash
RESULT=$(mysql -u username -ppassword --skip-column-names -e "SELECT count(*) FROM table" database)
echo $(date '+%Y/%m/%d %H:%M:%S') $RESULT >> $HOME/count.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment