Shell Script To Display The Running Process Running On The System Every 30 Seconds For 3 Times Only
Posted in Academic » Monitoring
#!/bin/bash # Write a shell script to display the process running on the system for every # 30 seconds, but only for 3 times. # ------------------------------------------------------------------------- # Copyright (c) 2008 nixCraft project <http://www.cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # ------------------------------------------------------------------------- # This script is part of nixCraft shell script collection (NSSC) # Visit http://bash.cyberciti.biz/ for more information. # ------------------------------------------------------------------------- # # for loop 3 times for r in 1 2 3 do #see every process on the system echo "**************************** x^x^x ****************************" ps -e echo "**************************** x^x^x ****************************" #sleep for 30 seconds sleep 3 # clean done
Download - Email this to a friend - Printable version
Is your site working? Monitor Your Web Site 24/7. Get SMS alerts on server downtime! Free 30-day trial including 20 SMS!
Related Other Helpful Shell Scripts:
- Shell Script To Auto Restart Apache HTTPD When it Goes Down / Dead
- Shell script to General FreeBSD and Linux System information
- Shell script to monitor services such as web/http, ssh, mail server
- NAS Backup Server Disk Monitoring Shell Script
- Shell script to restart MySQL server if it is killed or not working
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: for loop, loop method, ps command, shell loops, shell script, sleep command ~ Last updated on: September 13, 2008

