Using Shell Scripting to Automate Linux System Maintenance Tasks – Part 4

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

26 Responses

  1. Sunil Darna says:

    I’m trying to execute below script to get Memory information for clients. But It throwing error with ” bash: Total: command not found.

    bash: line 1: Used: command not found
    bash: line 2: Free: command not found

    I understood that shell is confused to execute “invited quotes”. But I used " ` " symbol also same output. Please help me to execute with desired output.


    echo "MEMORY"

    cmds="free -t -m | grep 'Mem' | awk '{ print "Total : "$2 " MB";print "Used : "$3" MB";print "Free : "$4" MB";}' "

    for ip in `cat /home/server.txt`
    ssh -i "/home/ec2-user/Office_Laptop_key.pem" [email protected]${ip} "$cmds"|tr '\n' ','|sed 's/,,/,NULL,/g'

  2. Sajal says:

    How can run this report to remote servers to gather the data and display for individual servers in one report.

  3. Bile says:

    With the help of this script I can show system information, thanks.

    Please post more related things like install lamp, network profiles and lots of more….

  4. Garima Jain says:

    Is there a way to execute powershell script from the shell script? (Calling ps1 from .sh file in centos)

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.