<?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 pass variable to crontab? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pass-variable-to-crontab/m-p/2517706#M871185</link>
    <description>Hi, &lt;BR /&gt;I am trying to pass a variable to a cron job that is currently exported in /etc/profile.&lt;BR /&gt;Is there a way to pass the variable transparent to the user (it is a password), apart from running the /etc/profile again within the script?&lt;BR /&gt;any theories greatly appreciated&lt;BR /&gt;Cheers&lt;BR /&gt;Ian</description>
    <pubDate>Tue, 17 Apr 2001 11:35:09 GMT</pubDate>
    <dc:creator>Dave Walley</dc:creator>
    <dc:date>2001-04-17T11:35:09Z</dc:date>
    <item>
      <title>pass variable to crontab?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pass-variable-to-crontab/m-p/2517706#M871185</link>
      <description>Hi, &lt;BR /&gt;I am trying to pass a variable to a cron job that is currently exported in /etc/profile.&lt;BR /&gt;Is there a way to pass the variable transparent to the user (it is a password), apart from running the /etc/profile again within the script?&lt;BR /&gt;any theories greatly appreciated&lt;BR /&gt;Cheers&lt;BR /&gt;Ian</description>
      <pubDate>Tue, 17 Apr 2001 11:35:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pass-variable-to-crontab/m-p/2517706#M871185</guid>
      <dc:creator>Dave Walley</dc:creator>
      <dc:date>2001-04-17T11:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: pass variable to crontab?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pass-variable-to-crontab/m-p/2517707#M871186</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;"...apart from running the /etc/profile again ..."&lt;BR /&gt;/etc/profile is not sourced automatically for cron jobs.  You will have to this explicitely in your cron job.&lt;BR /&gt;Placing passwords in files is always a security breach.  Personally I think /etc/profile is one of the worst places to put a password in: everyone has access to it.&lt;BR /&gt;If you need the password in the cron job you will have the read it from a file somewhere.&lt;BR /&gt;regards,&lt;BR /&gt;Thierry.</description>
      <pubDate>Tue, 17 Apr 2001 12:27:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pass-variable-to-crontab/m-p/2517707#M871186</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2001-04-17T12:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: pass variable to crontab?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pass-variable-to-crontab/m-p/2517708#M871187</link>
      <description>Hi Dave:&lt;BR /&gt;&lt;BR /&gt;There are several ways to provide environmental variables needed by a cron task:&lt;BR /&gt;&lt;BR /&gt;In general, environmental variables can be embedded in your script as necessary, or they can be specified and exported or file-sourced in the crontab entry like: &lt;BR /&gt;&lt;BR /&gt;0 1 * * * (V=x;export V;/home/my/script) &lt;BR /&gt;&lt;BR /&gt;0 1 * * * (. /home/my/.env /home/my/script)&lt;BR /&gt;&lt;BR /&gt;0 1 * * * su -c &lt;USER&gt; -c /home/my/script &lt;BR /&gt;&lt;BR /&gt;For maintainability, I would centralize environmental variables is one place.  For instance, you could maintain them in an "environmenal" file which would be sourced by your profile as well as any script needing them.  In this way changes need only be made once.&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/USER&gt;</description>
      <pubDate>Tue, 17 Apr 2001 13:40:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pass-variable-to-crontab/m-p/2517708#M871187</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-04-17T13:40:04Z</dc:date>
    </item>
  </channel>
</rss>

