Skip to content

Instantly share code, notes, and snippets.

@thecancerus
Last active April 25, 2019 06:56
Show Gist options
  • Save thecancerus/c4c10e966ac6bb04cc7191994e809bc1 to your computer and use it in GitHub Desktop.
Save thecancerus/c4c10e966ac6bb04cc7191994e809bc1 to your computer and use it in GitHub Desktop.
monitor aux
#!/usr/bin/env bash
# Back up Script to Daily Full Backups
# Source:
# Author: Amit
DAY=$(date +"%Y%m%d-%H%M")
DAY2=$(date +"%Y%m%d")
DAY3=$(date +"%Y%m")
mkdir -p /var/log/psx/$DAY3/$DAY2
ps aux > /var/log/psx/$DAY3/$DAY2/top$DAY.txt
pstree > /var/log/psx/$DAY3/$DAY2/tree$DAY.txt
free -mh > /var/log/psx/$DAY3/$DAY2/free$DAY.txt
#mysql -e 'show processlist\G' > /var/log/psx/sql$DAY.txt
top -b -n 1 > /var/log/psx/$DAY3/$DAY2/toporg$DAY.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment