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

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. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  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...

17 Responses

  1. Keenan Lawrence says:

    Such a brilliant article! Clear and concise. I love the reporting bit at the end. Thank you for taking the time to write this :)

  2. Raj says:

    I was asked to capture system information(s)and provide the output in excel sheet using Shell script which has to be automated. While browsing I came across this site and impressed with the way it was explained. How much would be the fee for preparing the script.

    Thanks

  3. Heena says:

    When I am trying to add done < <() i am getting below error

    filesystem.sh: line 10: syntax error near unexpected token `<'
    filesystem.sh: line 10: `done < <(df -h | grep -vi filesystem)'

    Can you please help me out here?

    Also, I am trying to run some scripts when my OS boots. I added the files in rc.local as well as /etc/init.d/ but it didnt help. I wanted to write some welcome script etc but it isnt working. Can you advice me? That will really help.

    Thanks

    • Việt Adm says:

      @Heena
      I also encountered the same error as you. To fix that, I did the following:

      df -h | while read line; do
      echo “” >> $WEB_DIR/report.html
      ….
      echo “” >> $WEB_DIR/report.html
      done

      It has worked well.

    • Việt Adm says:

      I have also encountered the same error as you. I’ve fixed it like this:

      df -h | while read line; do
      echo “” >> $WEB_DIR/report.html
      done

      I’m sure it works.
      By the way, I’m using CentOS.

  4. Andres says:

    Very good article , Gabriel. I’m starting in this topic to automate processes linux, and I found Super to start thinking about other tasks.

  5. Pavan says:

    sir i want to add user into system without password is it possible to write shell script for that…plz help for this topic

  6. poorva says:

    Please automate the below steps using shell script.

    [root@node1fs ~]# /etc/init.d/infrastructure_manager stop
    Stopping Infrastructure Manager Daemon [ OK ]
    [root@node1fs ~]# rpm -qa | grep object
    fm-objectshare-services-component-2.1-SNAPSHOT20160323191639.noarch
    [root@node1fs ~]# rpm -e fm-objectshare-services-component-2.1-SNAPSHOT20160323191639.noarch
    [root@node1fs ~]# rpm -ivh fm-objectshare-services-component-2.1-SNAPSHOT20160330045003.noarch.rpm
    Preparing… ########################################### [100%]
    Installing HTTP
    1:fm-objectshare-services########################################### [100%]
    [root@node1fs ~]# /etc/init.d/infrastructure_manager start
    Starting Infrastructure Manager Daemon [ OK ]
    waiting for PML start
    waiting for PML start
    waiting for PML start
    waiting for PML start
    Infrastructure Manager Daemon started.
    [root@node1fs ~]#

    • @poorva,
      We are currently offering support for cases like these. For a minimum fee, either Ravi Saive (the owner of Tecmint) or I can create a shell script that automates this process and creates a nice looking report. Feel free to contact us for a quotation if you want. We can answer questions related to this article for free as an added value, but for tasks that require further work we need to charge people a fee.

  7. vicotr says:

    this did not help

  8. Alican says:

    this did not help

    • @Alican,
      Would you mind very much explaining why “this did not help”? What were your expectations when you started reading this article? We would be happy to consider your suggestions to improve it.

Got something to say? Join the discussion.

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

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?