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
| #!/bin/bash | |
| BACKUP_ROOT="/mnt/backup" | |
| LOG_FILE="/var/log/rsync-backup.log" | |
| # Check if backup drive is mounted | |
| if ! mountpoint -q "$BACKUP_ROOT"; then | |
| echo "$(date): Backup drive not mounted!" | tee -a "$LOG_FILE" | |
| exit 1 | |
| fi |
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
| ps -eo pid,user,%mem,rss,comm --sort=-rss | awk 'NR==1{print $0" MB"; next} {printf "%s %s %s %d %s %.1f\n", $1,$2,$3,$4,$5,$4/1024}' | column -t | head -20 |