bash

How can I make a bash command run periodically?


I want to execute a script and have it run a command every x minutes.

Also any general advice on any resources for learning bash scripting could be really cool. I use Linux for my personal development work, so bash scripts are not totally foreign to me, I just haven't written any of my own from scratch.


Solution

  • If you want to run a command periodically, there's 3 ways :

    See cron

    Some pointers for best bash scripting practices :

    http://mywiki.wooledge.org/BashFAQ
    Guide: http://mywiki.wooledge.org/BashGuide
    ref: http://www.gnu.org/software/bash/manual/bash.html
    http://wiki.bash-hackers.org/
    USE MORE QUOTES!: http://www.grymoire.com/Unix/Quote.html
    Scripts and more: http://www.shelldorado.com/