<?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 Modification Script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017832#M5557</link>
    <description>A script should start with :&lt;BR /&gt;#!bin/bash&lt;BR /&gt;#&lt;BR /&gt;in order to let your system know it has to work with shell scripting.&lt;BR /&gt;Try adding a line after fi :&lt;BR /&gt;what if nothing changes ?&lt;BR /&gt;I suggest 'touch test.txt'  to debug,&lt;BR /&gt;then 'exit 0'  for final version.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;J</description>
    <pubDate>Tue, 08 Jul 2003 12:44:30 GMT</pubDate>
    <dc:creator>Jerome Henry</dc:creator>
    <dc:date>2003-07-08T12:44:30Z</dc:date>
    <item>
      <title>Crontab Modification Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017831#M5556</link>
      <description>#This script is to identify if the crontab has been modified and then emails the sys admin of the changes. For some reason i can't get the files created or an email sent when i test it out. I have it to run in the crontab every minute. Can somebody give me ideas?? Thanks! Semper Fi!&lt;BR /&gt;&lt;BR /&gt;crontab -l &amp;gt; /usr/local/apache/htdocs/harris/crontabtext&lt;BR /&gt;diff /usr/local/apache/htdocs/harris/crontabtext /usr/local/apache/htdocs/harris/crontabtext.backup &amp;gt; /tmp/crontab_changes&lt;BR /&gt;if [ -s /tmp/crontab_changes ]  #send mail if file is not empty&lt;BR /&gt;then&lt;BR /&gt;echo "The Crontab has been changed" | sendmail harriskd@matcom.usmc.mil&lt;BR /&gt;cp /usr/local/apache/htdocs/harris/crontabtext /usr/local/apache/htdocs/harris/crontabtext.backup&lt;BR /&gt;rm /tmp/crontab_changes&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Jul 2003 12:32:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017831#M5556</guid>
      <dc:creator>Kyle D. Harris</dc:creator>
      <dc:date>2003-07-08T12:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Crontab Modification Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017832#M5557</link>
      <description>A script should start with :&lt;BR /&gt;#!bin/bash&lt;BR /&gt;#&lt;BR /&gt;in order to let your system know it has to work with shell scripting.&lt;BR /&gt;Try adding a line after fi :&lt;BR /&gt;what if nothing changes ?&lt;BR /&gt;I suggest 'touch test.txt'  to debug,&lt;BR /&gt;then 'exit 0'  for final version.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;J</description>
      <pubDate>Tue, 08 Jul 2003 12:44:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017832#M5557</guid>
      <dc:creator>Jerome Henry</dc:creator>
      <dc:date>2003-07-08T12:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Crontab Modification Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017833#M5558</link>
      <description>Jerome-&lt;BR /&gt;  Thanks. That seemed to help. I finally got this script to at least run and the files got created when i would change the crontab. The only thing left not working is it sending email to me via sendmail. Is my sendmail line correct? It looks right to me. Thanks for your help. Pts have been rewarded! &lt;BR /&gt;&lt;BR /&gt;Kyle</description>
      <pubDate>Tue, 08 Jul 2003 13:06:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017833#M5558</guid>
      <dc:creator>Kyle D. Harris</dc:creator>
      <dc:date>2003-07-08T13:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Crontab Modification Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017834#M5559</link>
      <description>I think you should use the 'mail' command, not 'sendmail'. Just this substitution is enough.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;Claudio</description>
      <pubDate>Tue, 08 Jul 2003 13:13:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017834#M5559</guid>
      <dc:creator>Claudio Cilloni</dc:creator>
      <dc:date>2003-07-08T13:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Crontab Modification Script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017835#M5560</link>
      <description>Hi Kyle,&lt;BR /&gt;&lt;BR /&gt;tks fr your points !&lt;BR /&gt;&lt;BR /&gt;RE sendmail issue, your line is correct, except that message should follow endmail command :&lt;BR /&gt;try /usr/sbin/sendmail harriskd@matcom.usmc.mil &amp;lt;"The Crontab has been changed"&lt;BR /&gt;It should work.&lt;BR /&gt;Claudio suggestion would also work, as mail command works very well in the pipe option.&lt;BR /&gt;Glad your script works !&lt;BR /&gt;&lt;BR /&gt;J</description>
      <pubDate>Tue, 08 Jul 2003 13:42:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-modification-script/m-p/3017835#M5560</guid>
      <dc:creator>Jerome Henry</dc:creator>
      <dc:date>2003-07-08T13:42:54Z</dc:date>
    </item>
  </channel>
</rss>

