0
#!/bin/bash
# Checks rather system is running Linux or Solaris
function osCheck {
        os_type=$(uname -i)
        echo "Checking OS type."
        case ${os_type} in
                "x86_64")
                        linuxDiskCheck
                        ;;
                *)
                        solarisDiskCheck
                        ;;
        done

this is just test script

closed as unclear what you're asking by Rui F Ribeiro, Michael Homer, Mr Shunz, Haxiel, sebasth Feb 28 at 9:09

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to U&L. Have you gone through the documentation for cron on Solaris? Is there a more specific issue you want to address? – Haxiel Feb 26 at 13:07
  • You might want to check the syntax of your script at shellcheck.net It's missing several lines at the bottom, for example. – roaima Feb 27 at 18:08
1

Let suppose your script is located in /path/to/script.sh. You should make it executable:

chmod 700 /path/to/script.sh

Then executing crontab -e you get open editor (probably vi) where you enter

0 2 * * * /path/to/script.sh

This will execute the script once per day at 2h 0 minutes in the night. If you want to execute it every 4 hours you can enter (Linux)

0 */4 * * *  /path/to/script.sh

For Solaris you may need to enter the record on this way:

0 0,4,8,12,16,20 * * *  /path/to/script.sh

You may redirect the STDOUT and/or STDERR to file by your choise

Not the answer you're looking for? Browse other questions tagged or ask your own question.