<?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: how to configure crontab ? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372146#M35496</link>
    <description>Dear Vitaly Karasik  thanks for your kind help.&lt;BR /&gt;&lt;BR /&gt;# crontab crontab-file&lt;BR /&gt;&lt;BR /&gt;&amp;gt; If you want to use this just edit a file like /etc/crontab and write normal crontab &amp;gt; procedures. Then run&lt;BR /&gt;&amp;gt; # crontab /etc/crontab&lt;BR /&gt;&lt;BR /&gt;yes the above solution works :)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Problem with this is that crontab -l or -e won't show them (if &amp;gt; i remember correctly).&lt;BR /&gt;No, atleast the distro(SUSE) I am using works just apposite to what you said&lt;BR /&gt;in case of &lt;BR /&gt;# crontab /path/to/file &lt;BR /&gt;what happens is that it overwrites the root's crontab (/var/spool/cron/tabs/root)&lt;BR /&gt;and 'crontab -l' and 'crontab -e' shows all the jobs in /path/to/file&lt;BR /&gt;&lt;BR /&gt;Thanks Dear Vitaly Karasik&lt;BR /&gt;your suggestion also works ;).&lt;BR /&gt;the only difference I found is the path(it might be due to the distro difference).&lt;BR /&gt;On my box(SUSE 10 SP2) its inside /var/spool/cron/tabs directory&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
    <pubDate>Thu, 05 Mar 2009 12:14:27 GMT</pubDate>
    <dc:creator>Maaz</dc:creator>
    <dc:date>2009-03-05T12:14:27Z</dc:date>
    <item>
      <title>how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372143#M35493</link>
      <description>I have some(10) scripts that will be run via root's crontab, on almost 70 servers.&lt;BR /&gt;&lt;BR /&gt;I have configured crontab on one server, to run the scripts(all of the scripts are placed under /root/bin/ directory)&lt;BR /&gt;&lt;BR /&gt;question&lt;BR /&gt;1, is there an automated way to configure the crontab on rest of the 69 servers ?&lt;BR /&gt;e.g we can copy /etc/sudoers configured on  1 machine to other machines .. I mean is there any way to configure the crontab too ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Mar 2009 08:07:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372143#M35493</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2009-03-05T08:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372144#M35494</link>
      <description>What you can do is use a crontab-file.&lt;BR /&gt;&lt;BR /&gt;Problem with this is that crontab -l or -e won't show them (if i remember correctly).&lt;BR /&gt;&lt;BR /&gt;If you want to use this just edit a file like /etc/crontab and write normal crontab procedures. Then run &lt;BR /&gt;# crontab /etc/crontab&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
      <pubDate>Thu, 05 Mar 2009 08:25:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372144#M35494</guid>
      <dc:creator>Fredrik.eriksson</dc:creator>
      <dc:date>2009-03-05T08:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372145#M35495</link>
      <description>Yes, you can copy your /var/spool/cron/root file to all your linux boxes.&lt;BR /&gt;&lt;BR /&gt;Note - if these boxes already have root's crontab, you should use something like&lt;BR /&gt;&lt;BR /&gt;cat /tmp/root &amp;gt;&amp;gt;/var/spool/cron/root &lt;BR /&gt;&lt;BR /&gt;Other way is using /etc/cron.d/ directory</description>
      <pubDate>Thu, 05 Mar 2009 10:06:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372145#M35495</guid>
      <dc:creator>Vitaly Karasik_1</dc:creator>
      <dc:date>2009-03-05T10:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372146#M35496</link>
      <description>Dear Vitaly Karasik  thanks for your kind help.&lt;BR /&gt;&lt;BR /&gt;# crontab crontab-file&lt;BR /&gt;&lt;BR /&gt;&amp;gt; If you want to use this just edit a file like /etc/crontab and write normal crontab &amp;gt; procedures. Then run&lt;BR /&gt;&amp;gt; # crontab /etc/crontab&lt;BR /&gt;&lt;BR /&gt;yes the above solution works :)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Problem with this is that crontab -l or -e won't show them (if &amp;gt; i remember correctly).&lt;BR /&gt;No, atleast the distro(SUSE) I am using works just apposite to what you said&lt;BR /&gt;in case of &lt;BR /&gt;# crontab /path/to/file &lt;BR /&gt;what happens is that it overwrites the root's crontab (/var/spool/cron/tabs/root)&lt;BR /&gt;and 'crontab -l' and 'crontab -e' shows all the jobs in /path/to/file&lt;BR /&gt;&lt;BR /&gt;Thanks Dear Vitaly Karasik&lt;BR /&gt;your suggestion also works ;).&lt;BR /&gt;the only difference I found is the path(it might be due to the distro difference).&lt;BR /&gt;On my box(SUSE 10 SP2) its inside /var/spool/cron/tabs directory&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Mar 2009 12:14:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372146#M35496</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2009-03-05T12:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372147#M35497</link>
      <description>as mentioned above, it is possible to distribute somehow your crontab file to all of your servers and install it there.&lt;BR /&gt;&lt;BR /&gt;However, with such number of servers I would see problematic to maintain script up to date according latest changes/requirements.&lt;BR /&gt;What I would do is that I would export some shared folder from one of the servers (where crontabfile would be placed) and mounted it e.g. via NFS on the rest of the servers. this way you always have one copy of the script available on all the servers&lt;BR /&gt;Now it depends, whether all of your servers should have just the same (shared) crontab file or there can be slight differencies. if they are the same, you may want just to link root's crontab (/var/spool/cron/root) to your NFS-shared crontabfile. If there might be differencies you need to write short script that will compile together your central NFS shared crontabfile and local one and install it after every change of either central or local script.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;emha.</description>
      <pubDate>Fri, 06 Mar 2009 07:47:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372147#M35497</guid>
      <dc:creator>emha_1</dc:creator>
      <dc:date>2009-03-06T07:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372148#M35498</link>
      <description>&amp;gt;emha: you may want just to link root's crontab (/var/spool/cron/root)&lt;BR /&gt;&lt;BR /&gt;Directly changing the file /var/spool/cron/root may or may not work.  On HP-UX, cron needs to be notified of any changes, otherwise they would be ignored.</description>
      <pubDate>Sun, 08 Mar 2009 19:27:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372148#M35498</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-03-08T19:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372149#M35499</link>
      <description>yes, I believe different platforms may implement thing different ways (I have experience when on Tru64 it took some time until cron accepted changes made via crontab -e and new things 1 or 2 cycles weren't executed)&lt;BR /&gt;However, question is posted in linux forum ans there is SUSE distro mentioned above.&lt;BR /&gt; Here is what cron daemon man page on my SUSE 7.3 box says:&lt;BR /&gt;&lt;BR /&gt;----&lt;BR /&gt; Additionally,  cron  checks  each  minute  to  see  if  its  spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed.  Thus cron need not be&lt;BR /&gt;       restarted whenever a crontab file is modified.&lt;BR /&gt;----&lt;BR /&gt;&lt;BR /&gt;similar statement I have found in RHEL AS4 man page.&lt;BR /&gt;&lt;BR /&gt;so, to satisfy cron, it may be necessary to update timestamps of mentioned folders somehow (if SUSE 10.2 still relys on folder timestamps), but there is still advantage of having one central crontab file&lt;BR /&gt;&lt;BR /&gt;emha.</description>
      <pubDate>Sun, 08 Mar 2009 22:00:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372149#M35499</guid>
      <dc:creator>emha_1</dc:creator>
      <dc:date>2009-03-08T22:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372150#M35500</link>
      <description>thanks emha for such a nice tip&lt;BR /&gt;&amp;gt; However, with such number of servers I would see problematic to &lt;BR /&gt;&amp;gt; maintain script up to date according latest changes/requirements.&lt;BR /&gt;Yes I have done the following setup&lt;BR /&gt;on a server I have configured rsync&lt;BR /&gt;&lt;BR /&gt;on rsync server(192.168.0.6) I placed all the scripts under the /root/bin/scripts directory&lt;BR /&gt;and&lt;BR /&gt;under /root/bin/cron directory, I created a file 'root' that contains cron jobs&lt;BR /&gt;&lt;BR /&gt;# cat /etc/rsyncd.conf&lt;BR /&gt;&lt;BR /&gt;[scripts]&lt;BR /&gt;path = /root/bin/scripts&lt;BR /&gt;&lt;BR /&gt;[cron-jobs]&lt;BR /&gt;path = /root/bin/cron&lt;BR /&gt;&lt;BR /&gt;----&lt;BR /&gt;I then created a script, that will configure the cron jobs on all 69 servers.&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;while [ 1 != 0 ]; do&lt;BR /&gt;&lt;BR /&gt;clear&lt;BR /&gt;echo -e "\nTo quit, press CTRL+C\n"&lt;BR /&gt;echo -e "Please Enter the IP: "&lt;BR /&gt;read IP&lt;BR /&gt;&lt;BR /&gt;ssh -v "$IP"  "echo -e '*/1 * * * * /usr/bin/rsync -av 192.168.0.6::scripts /root/bin' &amp;gt;&amp;gt; /var/spool/cron/tabs/root"&lt;BR /&gt;ssh -v "$IP"  "echo -e '*/1 * * * * /usr/bin/rsync -av 192.168.0.6::cron-jobs /var/spool/cron/tabs' &amp;gt;&amp;gt; /var/spool/cron/tabs/root"&lt;BR /&gt;&lt;BR /&gt;if [ "$?" == "0" ] &lt;BR /&gt;  then echo "$IP on "$(date '+%d-%m-%Y')" crontab configured properly   ....  OK" &amp;gt;&amp;gt; /root/Servers_Done.log&lt;BR /&gt;  else echo "$IP on "$(date '+%d-%m-%Y')" crontab not configured        ....  failed" &amp;gt;&amp;gt; /root/Servers_Failed.log&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;and the above is working&lt;BR /&gt;&lt;BR /&gt;the only thing that doesnt seems to work is&lt;BR /&gt;&lt;BR /&gt;#ssh -v "$IP"  "echo -e '*/1 * * * * /usr/bin/rsync -av 192.168.0.6::scripts /root/bin' &amp;gt;&amp;gt; /var/spool/cron/tabs/root" &amp;amp;&amp;amp; "echo -e '*/1 * * * * /usr/bin/rsync -av 192.168.0.6::cron-jobs /var/spool/cron/tabs' &amp;gt;&amp;gt; /var/spool/cron/tabs/root"&lt;BR /&gt;&lt;BR /&gt;i.e if I use "&amp;amp;&amp;amp;"(instead of using ssh two times), then I got the following error&lt;BR /&gt;&lt;BR /&gt;test.sh: line 9: echo -e '*/1 * * * * /usr/bin/rsync -av 192.168.0.6::cron-jobs /var/spool/cron/tabs' &amp;gt;&amp;gt; /var/spool/cron/tabs/root: No such file or directory&lt;BR /&gt;&lt;BR /&gt;please help</description>
      <pubDate>Mon, 09 Mar 2009 06:15:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372150#M35500</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2009-03-09T06:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372151#M35501</link>
      <description>issue resolved&lt;BR /&gt;&lt;BR /&gt;ssh -v "$IP"  "echo -e '*/1 * * * * /usr/bin/rsync -av 192.168.0.6::scripts /root/bin' &amp;gt;&amp;gt; /var/spool/cron/tabs/root &amp;amp;&amp;amp; echo -e '*/1 * * * * /usr/bin/rsync -av 192.168.0.6::cron-jobs /var/spool/cron/tabs' &amp;gt;&amp;gt; /var/spool/cron/tabs/root"&lt;BR /&gt;&lt;BR /&gt;i.e following cause error:&lt;BR /&gt;ssh -v $IP "....." &amp;amp;&amp;amp; "...." &lt;BR /&gt;&lt;BR /&gt;and following works&lt;BR /&gt;ssh -v "$IP" "..... &amp;amp;&amp;amp; ...." &lt;BR /&gt;&lt;BR /&gt;DONE ;)&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Mar 2009 08:23:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372151#M35501</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2009-03-09T08:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to configure crontab ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372152#M35502</link>
      <description>With that number of servers, would be wise to implement some sort of job scheduler that will automatically spread the changes, the scripts can even be embedded in the job...&lt;BR /&gt;&lt;BR /&gt;Ref: &lt;A href="http://jobscheduler.sourceforge.net/" target="_blank"&gt;http://jobscheduler.sourceforge.net/&lt;/A&gt;</description>
      <pubDate>Mon, 09 Mar 2009 13:45:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-configure-crontab/m-p/4372152#M35502</guid>
      <dc:creator>Ciro  Iriarte</dc:creator>
      <dc:date>2009-03-09T13:45:46Z</dc:date>
    </item>
  </channel>
</rss>

