<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: scheduling a shell script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711101#M103620</link>
    <description>Hi Shiv,&lt;BR /&gt;&lt;BR /&gt;The best way although for executing the repeated jobs at a particular time is cron only. But as you already mentioned of asking the options apart from cron, a loop will be another option.&lt;BR /&gt;&lt;BR /&gt;at will work but it will only process the job only once and for rescheduleing either you reschedule it again or put the rescheduling option is the script itself.&lt;BR /&gt;&lt;BR /&gt;A loop will also achive the same function as you can sleep the loop for a particular time.&lt;BR /&gt;&lt;BR /&gt;The loop file shall contain&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;/path/script&lt;BR /&gt;sleep 86400&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The script should be executed at the right time initially, if not manually possible then use at for first use. Also you will require to restart it at every reboot.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender</description>
    <pubDate>Wed, 18 Jan 2006 01:32:40 GMT</pubDate>
    <dc:creator>Devender Khatana</dc:creator>
    <dc:date>2006-01-18T01:32:40Z</dc:date>
    <item>
      <title>scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711091#M103610</link>
      <description>Dear Sirs,&lt;BR /&gt;&lt;BR /&gt;i want to schedule a shell script jasmine.sh to execute every day at a particular time but don't want to put it in cron job. i want to execute as a login account on mine i.e. as a non-root user. &lt;BR /&gt;&lt;BR /&gt;how can i achieve this ?&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;shiv</description>
      <pubDate>Tue, 17 Jan 2006 11:41:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711091#M103610</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-01-17T11:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711092#M103611</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;Dear Shiv,&lt;BR /&gt;&lt;BR /&gt;you can add the entry in the crontab, ( in the command field)&lt;BR /&gt;&lt;BR /&gt;su - &lt;USERNAME&gt; -c &lt;SCRPIT_TO_BE_EXECUTED&gt;&lt;BR /&gt;&lt;BR /&gt;now, in the sheduled intervals , the script will be executed as the &lt;USERNAME&gt; specified in the above command ( and not as root). You can specify your username and your script.&lt;BR /&gt;&lt;BR /&gt;With Regards,&lt;BR /&gt;&lt;BR /&gt;Siva.&lt;/USERNAME&gt;&lt;/SCRPIT_TO_BE_EXECUTED&gt;&lt;/USERNAME&gt;</description>
      <pubDate>Tue, 17 Jan 2006 11:46:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711092#M103611</guid>
      <dc:creator>Sivakumar TS</dc:creator>
      <dc:date>2006-01-17T11:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711093#M103612</link>
      <description>You can use at:&lt;BR /&gt;&lt;BR /&gt;echo "/full_path/script.sh" | at 0200 tomorrow&lt;BR /&gt;&lt;BR /&gt;Just add that line to the end of your script and it will repeat every day.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 17 Jan 2006 11:47:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711093#M103612</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-01-17T11:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711094#M103613</link>
      <description>You can use cron to schedule jobs for users other than root.&lt;BR /&gt;&lt;BR /&gt;First the user must be allowed to use cron.  Add the user to /var/adm/cron/cron.allow&lt;BR /&gt;&lt;BR /&gt;Then the user can edit his/her crontab with the 'crontab -e' command.  Or root can edit another users crontab via 'crontab -e username'.&lt;BR /&gt;&lt;BR /&gt;When the jobs run they will be run as that user.</description>
      <pubDate>Tue, 17 Jan 2006 11:55:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711094#M103613</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2006-01-17T11:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711095#M103614</link>
      <description>Pete has just given the best idea.&lt;BR /&gt;&lt;BR /&gt;The use of echo "/$PATH/filename" | at &lt;TIME&gt; tomorrow&lt;/TIME&gt;</description>
      <pubDate>Tue, 17 Jan 2006 13:44:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711095#M103614</guid>
      <dc:creator>Lolupee</dc:creator>
      <dc:date>2006-01-17T13:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711096#M103615</link>
      <description>apologies, you must be permitted to use "at" on the server for this.&lt;BR /&gt;&lt;BR /&gt;let sysadm add your name to at.allow</description>
      <pubDate>Tue, 17 Jan 2006 13:49:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711096#M103615</guid>
      <dc:creator>Lolupee</dc:creator>
      <dc:date>2006-01-17T13:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711097#M103616</link>
      <description>HP SIM can do this for you.  (I am talking SIM 5, not the older revs.  I also don't know if you have it installed or are familiar with it.)&lt;BR /&gt;&lt;BR /&gt;I use HP SIM to login and run commands for me regularly, and it has a 'run now' option, and a 'schedule' option.&lt;BR /&gt;&lt;BR /&gt;Short of running cron or some other scheduler, this is likely your best (free) bet.  SIM is normally used for monitoring, but I use it for sysadmin tasks much more than monitoring.&lt;BR /&gt;&lt;BR /&gt;Hope it helps&lt;BR /&gt;&lt;BR /&gt;John</description>
      <pubDate>Tue, 17 Jan 2006 13:57:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711097#M103616</guid>
      <dc:creator>John Payne_2</dc:creator>
      <dc:date>2006-01-17T13:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711098#M103617</link>
      <description>Hi Shiv, &lt;BR /&gt;&lt;BR /&gt;"at" is the command to help you. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-60127/at.1.html" target="_blank"&gt;http://docs.hp.com/en/B2355-60127/at.1.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Tue, 17 Jan 2006 23:04:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711098#M103617</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-01-17T23:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711099#M103618</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;i usually prefer:&lt;BR /&gt;&lt;BR /&gt;20   09  *   *   *  echo "/prod/myscripts/jasmine.sh"|su - shiv 1&amp;gt;/prod/script/logfiles/output-jasmine.crn 2&amp;gt;/prod/script/logfiles/error-jasmine.crn &lt;BR /&gt;&lt;BR /&gt;using cron of course&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Tue, 17 Jan 2006 23:22:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711099#M103618</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-01-17T23:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711100#M103619</link>
      <description>Hi shiva,&lt;BR /&gt;   you can use both "at" and cron jobs to do it.</description>
      <pubDate>Tue, 17 Jan 2006 23:41:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711100#M103619</guid>
      <dc:creator>Senthil Prabu.S_1</dc:creator>
      <dc:date>2006-01-17T23:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711101#M103620</link>
      <description>Hi Shiv,&lt;BR /&gt;&lt;BR /&gt;The best way although for executing the repeated jobs at a particular time is cron only. But as you already mentioned of asking the options apart from cron, a loop will be another option.&lt;BR /&gt;&lt;BR /&gt;at will work but it will only process the job only once and for rescheduleing either you reschedule it again or put the rescheduling option is the script itself.&lt;BR /&gt;&lt;BR /&gt;A loop will also achive the same function as you can sleep the loop for a particular time.&lt;BR /&gt;&lt;BR /&gt;The loop file shall contain&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;/path/script&lt;BR /&gt;sleep 86400&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The script should be executed at the right time initially, if not manually possible then use at for first use. Also you will require to restart it at every reboot.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender</description>
      <pubDate>Wed, 18 Jan 2006 01:32:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711101#M103620</guid>
      <dc:creator>Devender Khatana</dc:creator>
      <dc:date>2006-01-18T01:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711102#M103621</link>
      <description>Hi Shiv,&lt;BR /&gt;you can sue 'at' command or if you have an Oracle instance you can use the dbms_jobs package.&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Wed, 18 Jan 2006 04:43:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711102#M103621</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2006-01-18T04:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711103#M103622</link>
      <description>Lolupee's idea is good. Devender, is 86400 execute every day at a particular time ?</description>
      <pubDate>Wed, 18 Jan 2006 11:26:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711103#M103622</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-01-18T11:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711104#M103623</link>
      <description>Sorry, it was Pete Randall's idea. Thanks Pete!!</description>
      <pubDate>Wed, 18 Jan 2006 11:28:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711104#M103623</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-01-18T11:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711105#M103624</link>
      <description>The 'sleep 86400' will cause the script to sleep for 86,400 seconds or 24 hours.  It will then execute again.</description>
      <pubDate>Wed, 18 Jan 2006 11:28:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711105#M103624</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2006-01-18T11:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711106#M103625</link>
      <description>Be weary of using at to continuously reschedule a job that has to run every day.&lt;BR /&gt;&lt;BR /&gt;All it has to do is fail to finish the script once for any reason and its not scheduled any more.  On the same note, all it has to do is get run one extra time manually and suddenly its scheduled twice.&lt;BR /&gt;&lt;BR /&gt;Based on your original request I would recommend using cron for that user instead of the root cron.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;H</description>
      <pubDate>Wed, 18 Jan 2006 17:06:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711106#M103625</guid>
      <dc:creator>Howard Marshall</dc:creator>
      <dc:date>2006-01-18T17:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711107#M103626</link>
      <description>Hi Shiv,&lt;BR /&gt;&lt;BR /&gt;sleep 86400 will repeat the process after that manu seconds. &lt;BR /&gt;&lt;BR /&gt;Caution - After every execution the time will be reduced by one second and obviously after 30 days in sequence you will find that the command is actually executing 30 sec. prior to the time set.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Devender</description>
      <pubDate>Thu, 19 Jan 2006 01:17:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711107#M103626</guid>
      <dc:creator>Devender Khatana</dc:creator>
      <dc:date>2006-01-19T01:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711108#M103627</link>
      <description>Hi Shiv, &lt;BR /&gt;&lt;BR /&gt;sleep 86400 will execute a script after 24 hrs exactly comleting the first run. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://unix.derkeiler.com/Mailing-Lists/HP-UX-Admin/2004-09/0038.html" target="_blank"&gt;http://unix.derkeiler.com/Mailing-Lists/HP-UX-Admin/2004-09/0038.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Thu, 19 Jan 2006 01:25:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711108#M103627</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-01-19T01:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711109#M103628</link>
      <description>Sir,&lt;BR /&gt;&lt;BR /&gt;I put the below line at the end of the script shiv.sh&lt;BR /&gt;&lt;BR /&gt;echo "/home/sksonkar/shiv.sh"|at 0200 tomorrow&lt;BR /&gt;&lt;BR /&gt;how does the shiv.sh script gets invoked at 2am tomorrow; because the line is at the end of the sript shiv.sh ?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shiv&lt;BR /&gt;</description>
      <pubDate>Sat, 21 Jan 2006 17:21:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711109#M103628</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-01-21T17:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: scheduling a shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711110#M103629</link>
      <description>Hi Shiv:&lt;BR /&gt;&lt;BR /&gt;You asked if you do:&lt;BR /&gt;&lt;BR /&gt;# echo "/home/sksonkar/shiv.sh"|at 0200 tomorrow&lt;BR /&gt;&lt;BR /&gt;"How does the shiv.sh script gets invoked at 2am tomorrow?"&lt;BR /&gt;&lt;BR /&gt;This is just another way of specifying the filename that you want 'at' to run.  The STDIN file descriptor (usually your terminal) is what is being read by 'at'.  You can shorten this to:&lt;BR /&gt;&lt;BR /&gt;# /home/sksonkar/shiv.sh|at 0200 tomorrow&lt;BR /&gt;&lt;BR /&gt;... or write equivalent specifications for starting your script tomorrow (January 22 at 0200):&lt;BR /&gt;&lt;BR /&gt;# at -f /home/sksonkar/shiv.sh 0200 tomorrow&lt;BR /&gt;&lt;BR /&gt;# at -t 01220200 -f /home/sksonkar/shiv.sh&lt;BR /&gt;&lt;BR /&gt;Have a look at the manpages for 'at' for more information.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 21 Jan 2006 18:18:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/scheduling-a-shell-script/m-p/3711110#M103629</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-01-21T18:18:53Z</dc:date>
    </item>
  </channel>
</rss>

