<?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 entry automation in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780935#M99341</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you want a change without changing - that is not possible :-) .&lt;BR /&gt;If you mean a 'batch change' without opening an editor:&lt;BR /&gt;&lt;BR /&gt;crontab -l &amp;gt;/tmp/crontab.save&lt;BR /&gt;cp /tmp/crontab.save /tmp/crontab.new&lt;BR /&gt;print '1 2 3 4 * new-cronjob' &amp;gt;&amp;gt;/tmp/crontab.new&lt;BR /&gt;crontab /tmp/crontab.new&lt;BR /&gt;&lt;BR /&gt;You have '/tmp/crontab.save' as a backup if something goes wrong ...&lt;BR /&gt;&lt;BR /&gt;Perhaps you better check if 'new-cronjob' does not already exists.&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;</description>
    <pubDate>Tue, 02 May 2006 10:16:58 GMT</pubDate>
    <dc:creator>Peter Nikitka</dc:creator>
    <dc:date>2006-05-02T10:16:58Z</dc:date>
    <item>
      <title>crontab entry automation</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780932#M99338</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need to automate updating the cron entry in my server.&lt;BR /&gt;&lt;BR /&gt;Is there any way in which I can add an entry to the end of the crontab without actually opening the cron file.&lt;BR /&gt;&lt;BR /&gt;-Pat</description>
      <pubDate>Tue, 02 May 2006 10:08:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780932#M99338</guid>
      <dc:creator>Pat Peter</dc:creator>
      <dc:date>2006-05-02T10:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: crontab entry automation</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780933#M99339</link>
      <description>You could do something like:&lt;BR /&gt;&lt;BR /&gt;echo "5 4 * * 1 /dir/command_to_run" &amp;gt;&amp;gt; /var/spool/cron/crontabs/root&lt;BR /&gt;&lt;BR /&gt;If you do that, you will then have to stop and restart the cron daemon for the change to take effect.  Otherwise your job will not run.</description>
      <pubDate>Tue, 02 May 2006 10:13:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780933#M99339</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2006-05-02T10:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: crontab entry automation</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780934#M99340</link>
      <description>Shalom Pat,&lt;BR /&gt;&lt;BR /&gt;Yes,&lt;BR /&gt;&lt;BR /&gt;You can echo directly to /var/spool/cron/crontab.root&lt;BR /&gt;&lt;BR /&gt;This is not recommended by me but quite possible&lt;BR /&gt;&lt;BR /&gt;echo "10 16 * * * /usr/local/bin/job 2&amp;gt;&amp;amp;1" &amp;gt;&amp;gt; /var/spool/cron/crontab.root&lt;BR /&gt;&lt;BR /&gt;I don't do this, and you may need to start and stop the cron daemon.&lt;BR /&gt;&lt;BR /&gt;Really the best way to go is to edit the file or a copy of he file. &lt;BR /&gt;&lt;BR /&gt;Some will not run crontab -e.&lt;BR /&gt;&lt;BR /&gt;I once had an operator come to me with apologies because a PC power supply failure wile editing a regular users crontab file caused it to be empty.&lt;BR /&gt;&lt;BR /&gt;It was restored from backup, but messing with the file directly does risk that outcome.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 May 2006 10:13:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780934#M99340</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-05-02T10:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: crontab entry automation</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780935#M99341</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you want a change without changing - that is not possible :-) .&lt;BR /&gt;If you mean a 'batch change' without opening an editor:&lt;BR /&gt;&lt;BR /&gt;crontab -l &amp;gt;/tmp/crontab.save&lt;BR /&gt;cp /tmp/crontab.save /tmp/crontab.new&lt;BR /&gt;print '1 2 3 4 * new-cronjob' &amp;gt;&amp;gt;/tmp/crontab.new&lt;BR /&gt;crontab /tmp/crontab.new&lt;BR /&gt;&lt;BR /&gt;You have '/tmp/crontab.save' as a backup if something goes wrong ...&lt;BR /&gt;&lt;BR /&gt;Perhaps you better check if 'new-cronjob' does not already exists.&lt;BR /&gt;&lt;BR /&gt;mfG Peter&lt;BR /&gt;</description>
      <pubDate>Tue, 02 May 2006 10:16:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780935#M99341</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-05-02T10:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: crontab entry automation</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780936#M99342</link>
      <description>Never, ever edit the crontab directly. If you do, cron won't have a clue that that has been done until cron is restarted or receives a SIGHUP. The correct procedure is to use the crontab command to extract the current cron entries and then to read them back in. Crontab also sends a SIGHUP (kill -1) to cron to trigger a re-read.&lt;BR /&gt;&lt;BR /&gt;Something like this should work:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;typeset TDIR=${TMPDIR:-/var/tmp}&lt;BR /&gt;typeset C1=${TDIR}/X${$}_1.cron&lt;BR /&gt;&lt;BR /&gt;crontab -l &amp;gt; ${C1}&lt;BR /&gt;echo "15 23 * * * /new/command/goes_here # comment for new command" &amp;gt;&amp;gt; ${C1}&lt;BR /&gt;crontab &amp;lt; ${C1}&lt;BR /&gt;&lt;BR /&gt;rm -f ${C1}&lt;BR /&gt;&lt;BR /&gt;You should add a little error checking and probably get the new entry from the command line but that's the gist of it.&lt;BR /&gt;</description>
      <pubDate>Tue, 02 May 2006 10:32:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780936#M99342</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-05-02T10:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: crontab entry automation</title>
      <link>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780937#M99343</link>
      <description>Demat Pat,&lt;BR /&gt;&lt;BR /&gt;Another way to do it is to use dsau(Distributed Systems Administration Utility) if you have several servers. If you just have one it's not a good idea and should be a waste of time to configure it.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-90950/ch03s04.html" target="_blank"&gt;http://docs.hp.com/en/B2355-90950/ch03s04.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you can't use it directly due to some OS restriction, go directly to the site  of the GNU product cfengine(&lt;A href="http://www.cfengine.org/)." target="_blank"&gt;http://www.cfengine.org/).&lt;/A&gt; This product deserve to work on it,it should verify and edit (if it need) the cron for you and restart or not the daemon. Cfengine can do much more, take a look.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Kenavo&lt;BR /&gt;Pat&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 02 May 2006 11:39:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/crontab-entry-automation/m-p/3780937#M99343</guid>
      <dc:creator>Patrice Le Guyader</dc:creator>
      <dc:date>2006-05-02T11:39:42Z</dc:date>
    </item>
  </channel>
</rss>

