This discussion is archived
3 Replies Latest reply: Jan 10, 2013 11:15 PM by 983773 RSS

Bash script with Cron job

983773 Newbie
Currently Being Moderated
Hello,

This is my first post:-)

we have developed one script to do basic LDAP healthcheck and tested. It's working fine. But have to run manually daily. I want to put that script in cron job.
So that it generates reports automatically. Can some one please give me the hit on it or any links which i could understand more easily.

Thanks.
  • 1. Re: Bash script with Cron job
    Marco Milo Journeyer
    Currently Being Moderated
    Hi,
    this doesn't look exactly like a DS-related question, however the best option would be 'man crontab' / 'man cron' and read the man pages ;-)

    But, assuming you're running Solaris 10... and you would like to run your script every day of every month of every week at 1:30 AM... you should add the following line to your crontab:

    1 30 * * * /full/path/to/your/script.sh

    HTH,
    Marco
  • 2. Re: Bash script with Cron job
    802907 Journeyer
    Currently Being Moderated
    Just to elaborate a bit more, the command to edit your crontab is usually:

    crontab -e

    And to list it:

    crontab -l

    If crontab -e isn't working, you may need to be added to the list of users allowed to use it, or you may need to set your editor:

    export EDITOR=vi

    (that's in bash)
  • 3. Re: Bash script with Cron job
    983773 Newbie
    Currently Being Moderated
    thanks macro and chris for your suggestions. Great experience with my first post..:-)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points