how to to put a shell script in crontab in solaris to automate the script [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












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










share|improve this question















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















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










share|improve this question















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













0












0








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










share|improve this question
















#!/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







cron






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 26 at 13:40









Romeo Ninov

6,83432129




6,83432129










asked Feb 26 at 12:40









user4485user4485

11




11




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.









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

















  • 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
















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





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





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 Answer
1






active

oldest

votes


















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






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    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






    share|improve this answer



























      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






      share|improve this answer

























        1












        1








        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






        share|improve this answer













        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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 26 at 13:46









        Romeo NinovRomeo Ninov

        6,83432129




        6,83432129












            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?