<?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: crontab job and run on shell in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944102#M27043</link>
    <description>Environment.&lt;BR /&gt;&lt;BR /&gt;The cron environment has nowhere near the PATH and other shell environment available to it.&lt;BR /&gt;&lt;BR /&gt;So if you rely upon a shell-based environment variable or 'alias', these need to be put into the shell script you're running from cron.&lt;BR /&gt;&lt;BR /&gt;Also note, that you *MUST HAVE* the hash-bang ('#!/bin/bash') at the start (along with executable permissions), otherwise cron won't know how it executes.</description>
    <pubDate>Wed, 14 Feb 2007 00:59:43 GMT</pubDate>
    <dc:creator>Stuart Browne</dc:creator>
    <dc:date>2007-02-14T00:59:43Z</dc:date>
    <item>
      <title>crontab job and run on shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944101#M27042</link>
      <description>I hv a crontab job (script) that can be run normally , now I try to run it on the shell but can't be run ( I sure I don't have any typing mistake as I copy the statement from the crontab ) ,  can advise what is difference between run a script on crontab and manually ? thx</description>
      <pubDate>Tue, 13 Feb 2007 20:45:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944101#M27042</guid>
      <dc:creator>hangyu</dc:creator>
      <dc:date>2007-02-13T20:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job and run on shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944102#M27043</link>
      <description>Environment.&lt;BR /&gt;&lt;BR /&gt;The cron environment has nowhere near the PATH and other shell environment available to it.&lt;BR /&gt;&lt;BR /&gt;So if you rely upon a shell-based environment variable or 'alias', these need to be put into the shell script you're running from cron.&lt;BR /&gt;&lt;BR /&gt;Also note, that you *MUST HAVE* the hash-bang ('#!/bin/bash') at the start (along with executable permissions), otherwise cron won't know how it executes.</description>
      <pubDate>Wed, 14 Feb 2007 00:59:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944102#M27043</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-02-14T00:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job and run on shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944103#M27044</link>
      <description>thx reply,&lt;BR /&gt;&lt;BR /&gt;I still have a bit misunderstand , do you mean I need to add ('#!/bin/bash') at the beginning of my script ? if not that , can advise what I need to do ? thx</description>
      <pubDate>Wed, 14 Feb 2007 03:43:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944103#M27044</guid>
      <dc:creator>hangyu</dc:creator>
      <dc:date>2007-02-14T03:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job and run on shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944104#M27045</link>
      <description>What is the error that you get? Ensure that a line was not divided in two during the copy/paste operation.</description>
      <pubDate>Wed, 14 Feb 2007 08:21:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944104#M27045</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-02-14T08:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job and run on shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944105#M27046</link>
      <description>agree. environment is the issue.&lt;BR /&gt;also please add the path of the command to the PATH environment variable. Like PATH=$PATH:/usr/lcoal/bin&lt;BR /&gt;&lt;BR /&gt;or use full path for all the commands in the script.</description>
      <pubDate>Wed, 14 Feb 2007 15:08:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944105#M27046</guid>
      <dc:creator>Wilfred Chau_1</dc:creator>
      <dc:date>2007-02-14T15:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job and run on shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944106#M27047</link>
      <description>Remember that the problem is not as usual. The problem is that the script works in cron but does not work in the shell.</description>
      <pubDate>Wed, 14 Feb 2007 15:15:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944106#M27047</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-02-14T15:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: crontab job and run on shell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944107#M27048</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;As noted, the environment in which a 'crontask' runs is sparse.  Instead of adding the environmental variables you commonly need (e.g. PATH, etc.) to every script that you 'cron', source (read) a file that you define specifically to hold environmental variables.&lt;BR /&gt;&lt;BR /&gt;Thus, your scripts would begin something like this:&lt;BR /&gt;&lt;BR /&gt;# cat ./myscript&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;. /home/hangyu/config&lt;BR /&gt;echo "hello ${WHO}"&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;# cat ./config&lt;BR /&gt;WHO=Hangyu&lt;BR /&gt;&lt;BR /&gt;Then run:&lt;BR /&gt;&lt;BR /&gt;# ./myscript&lt;BR /&gt;&lt;BR /&gt;...Now you have defined *one* configuation file that you can modify for *all* your scripts' needs.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Feb 2007 17:45:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-job-and-run-on-shell/m-p/3944107#M27048</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-02-14T17:45:15Z</dc:date>
    </item>
  </channel>
</rss>

