<?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 Editing crontab files the wrong way... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044417#M135002</link>
    <description>Hi Gents and Gals,&lt;BR /&gt;&lt;BR /&gt;I believe I goofed when I tried to edit the crontab files. I edited the files directly with vi...and when poking around this site and executing a search on 'edit crontabs' I came across some interesting topics, one which states that a user should do this:&lt;BR /&gt;&lt;BR /&gt;crontab -l &amp;gt; cron.file&lt;BR /&gt;vi cron.file&lt;BR /&gt;(make the changes you want)&lt;BR /&gt;crontab cron.file&lt;BR /&gt;&lt;BR /&gt;I have a question, since I edited the crontab file directly (as sudo root), and want to undo my changes, do I just vi to the crontab file and remove what changes I made?&lt;BR /&gt;&lt;BR /&gt;Another question, the procedure I have indicated above, this simply takes the crontab file contents, and puts in another file (or renames it), and makes the necessary changes, and makes this recently renamed file the crontab file. What is wrong with editing the ctonrab file directly, if you make a coly of the file and append .old to the file?&lt;BR /&gt;&lt;BR /&gt;Should I just try to use crontab -e?&lt;BR /&gt;&lt;BR /&gt;Please mention if I should remove the edits I made to the file via vi directly. &lt;BR /&gt;&lt;BR /&gt;By the way, I was going to set up the system to reboot on a weekly basis, and this never happened and I believe it is because I did not edit the crontab file correctly, even though I set up the parameters right.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.</description>
    <pubDate>Thu, 07 Aug 2003 18:46:58 GMT</pubDate>
    <dc:creator>Denise_22</dc:creator>
    <dc:date>2003-08-07T18:46:58Z</dc:date>
    <item>
      <title>Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044417#M135002</link>
      <description>Hi Gents and Gals,&lt;BR /&gt;&lt;BR /&gt;I believe I goofed when I tried to edit the crontab files. I edited the files directly with vi...and when poking around this site and executing a search on 'edit crontabs' I came across some interesting topics, one which states that a user should do this:&lt;BR /&gt;&lt;BR /&gt;crontab -l &amp;gt; cron.file&lt;BR /&gt;vi cron.file&lt;BR /&gt;(make the changes you want)&lt;BR /&gt;crontab cron.file&lt;BR /&gt;&lt;BR /&gt;I have a question, since I edited the crontab file directly (as sudo root), and want to undo my changes, do I just vi to the crontab file and remove what changes I made?&lt;BR /&gt;&lt;BR /&gt;Another question, the procedure I have indicated above, this simply takes the crontab file contents, and puts in another file (or renames it), and makes the necessary changes, and makes this recently renamed file the crontab file. What is wrong with editing the ctonrab file directly, if you make a coly of the file and append .old to the file?&lt;BR /&gt;&lt;BR /&gt;Should I just try to use crontab -e?&lt;BR /&gt;&lt;BR /&gt;Please mention if I should remove the edits I made to the file via vi directly. &lt;BR /&gt;&lt;BR /&gt;By the way, I was going to set up the system to reboot on a weekly basis, and this never happened and I believe it is because I did not edit the crontab file correctly, even though I set up the parameters right.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.</description>
      <pubDate>Thu, 07 Aug 2003 18:46:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044417#M135002</guid>
      <dc:creator>Denise_22</dc:creator>
      <dc:date>2003-08-07T18:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044418#M135003</link>
      <description>Hi Denise:&lt;BR /&gt;&lt;BR /&gt;I never use 'crontab -e'.  Instead I use the sequence you described:&lt;BR /&gt;&lt;BR /&gt;# crontab -l &amp;gt; mycrontab&lt;BR /&gt;# vi mycrontab&lt;BR /&gt;# crontab mycrontab&lt;BR /&gt;&lt;BR /&gt;The rationale for *not* editing directly (with '-e' is that if I bungle the edit and exit 'vi' the copy (overwrite) of the crontab entry occurs anyway -- not very desirable.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 07 Aug 2003 18:53:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044418#M135003</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-08-07T18:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044419#M135004</link>
      <description>JRF,&lt;BR /&gt;&lt;BR /&gt;Thanks. Ok...now do I need to vi the crontab file directly and remove what I put in the crontab. That is...undo my errors? &lt;BR /&gt;&lt;BR /&gt;I figured I would just use the procedure I indicated in the post, but would my original edit show up?&lt;BR /&gt;&lt;BR /&gt;Also, the server never rebooted after I edited the crontab file directoyl. Do you think that it is because of the wrong way I edited the crontab file?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 07 Aug 2003 19:00:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044419#M135004</guid>
      <dc:creator>Denise_22</dc:creator>
      <dc:date>2003-08-07T19:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044420#M135005</link>
      <description>Denise,&lt;BR /&gt;&lt;BR /&gt;You're choices for undoing what you've done are:&lt;BR /&gt;&lt;BR /&gt;1) vi it and undo, as you said.&lt;BR /&gt;&lt;BR /&gt;2) restore from backup.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Aug 2003 19:02:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044420#M135005</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-08-07T19:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044421#M135006</link>
      <description>Hi Denise,&lt;BR /&gt;&lt;BR /&gt;In my HP student workbook (HP-UX System Administration I) it says that " files in /var/spool/cron/crontabs should never be edited directly or removed because doing so can leave the cron daemon in an idefined state" (??)&lt;BR /&gt;&lt;BR /&gt;I guess you need kill and restart the cron daemon with these two commands:&lt;BR /&gt;&lt;BR /&gt;       /sbin/init.d/cron stop&lt;BR /&gt;       /sbin/init.d/cron start&lt;BR /&gt;&lt;BR /&gt;and resubmit your jobs correctly.&lt;BR /&gt;&lt;BR /&gt;Elena.</description>
      <pubDate>Thu, 07 Aug 2003 19:04:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044421#M135006</guid>
      <dc:creator>Elena Leontieva</dc:creator>
      <dc:date>2003-08-07T19:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044422#M135007</link>
      <description>Sorry for typo: "undefined state"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Aug 2003 19:06:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044422#M135007</guid>
      <dc:creator>Elena Leontieva</dc:creator>
      <dc:date>2003-08-07T19:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044423#M135008</link>
      <description>If you are sure of your editing skills, you can use crontab -e to undo the changes.  This will also reload the files to the cron daemon so you will be actually scheduled for what's in the file.&lt;BR /&gt;&lt;BR /&gt;Alternatively, you can do the crontab -l &amp;gt; file routine and use *view* to edit.  View has the inherant benefit of being explicitly read-only. This means you have to do wq! to commit any changes before exiting the editor.&lt;BR /&gt;&lt;BR /&gt;mark</description>
      <pubDate>Thu, 07 Aug 2003 19:08:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044423#M135008</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2003-08-07T19:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044424#M135009</link>
      <description>Your EDITOR environment variable will determine how crontab -e works.&lt;BR /&gt;&lt;BR /&gt;echo $EDITOR&lt;BR /&gt;&lt;BR /&gt;Chances are its the default value, vi.&lt;BR /&gt;&lt;BR /&gt;Which is what you're using, right?&lt;BR /&gt;&lt;BR /&gt;The only difference that I'm aware of with crontab is the use of csh instead of POSIX or korn.</description>
      <pubDate>Thu, 07 Aug 2003 19:14:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044424#M135009</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-08-07T19:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044425#M135010</link>
      <description>I will vi the crontab file and edit it directly. And start stop the daemon, just to be sure its running. I will then edit my crontab file using this method:&lt;BR /&gt;&lt;BR /&gt;crontab -l &amp;gt; cron.file&lt;BR /&gt;vi cron.file&lt;BR /&gt;crontab cron.file&lt;BR /&gt;&lt;BR /&gt;I just hope when I edit the file directly via vi, it does not screw anything up or make it worse, which is why I inquired.&lt;BR /&gt;&lt;BR /&gt;Thank you folks!</description>
      <pubDate>Thu, 07 Aug 2003 19:21:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044425#M135010</guid>
      <dc:creator>Denise_22</dc:creator>
      <dc:date>2003-08-07T19:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044426#M135011</link>
      <description>Editing the cron files directly can cause problems, like multiple cron processes running, or none at all. Otherwise, there is likely little perminant damage done by your procedure.&lt;BR /&gt;&lt;BR /&gt;I'd use the procedures listed above to stop cron, look for any other cron processes. assuming none, recreate the cron file, put it back, as described, then start cron.&lt;BR /&gt;&lt;BR /&gt;Put a test job in as well, that runs soon after you anticapate being finished.&lt;BR /&gt;&lt;BR /&gt;10 * * * * * mailx me@.com &amp;lt; testfile&lt;BR /&gt;&lt;BR /&gt;make sure you get the mail, and only one of them.</description>
      <pubDate>Thu, 07 Aug 2003 19:27:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044426#M135011</guid>
      <dc:creator>doug mielke</dc:creator>
      <dc:date>2003-08-07T19:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044427#M135012</link>
      <description>...darn,&lt;BR /&gt;" make sure you get only one mail" when my example will give you one every hour forever.&lt;BR /&gt;sorry  :(</description>
      <pubDate>Thu, 07 Aug 2003 19:30:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044427#M135012</guid>
      <dc:creator>doug mielke</dc:creator>
      <dc:date>2003-08-07T19:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044428#M135013</link>
      <description>After editing, you DO NOT NEED OR WANT to stop cron. If you insist upon editing directly then you must tell the cron daemon that the file has changed. Do a ps -e grep "cron" and note the PID of the cron daemon and then issue a kill -1 pid (or if you prefer a kill -s HUP pid) to send a HANGUP signal to the cron daemon. Cron will then fire off a signal handler to reread the file. This is done automatically by crontab after checking for syntax errors. That's why it's always best to use crontab but since you have already done gone and edited the file directly all you really need is a kill -1 and, assuming your little fingers didn't make no mistakes, you are done.&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Aug 2003 19:33:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044428#M135013</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-08-07T19:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044429#M135014</link>
      <description>I certainly defer to Clay, and I'm wondering...&lt;BR /&gt;&lt;BR /&gt;Clay, Are there any risks to stopping and starting cron from init.d? ( I suppose we could prevent a job from running if it's scheduled time passes while we're moving files around)&lt;BR /&gt;&lt;BR /&gt;Any others?</description>
      <pubDate>Thu, 07 Aug 2003 20:06:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044429#M135014</guid>
      <dc:creator>doug mielke</dc:creator>
      <dc:date>2003-08-07T20:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044430#M135015</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Just a couple of points from your original question.&lt;BR /&gt;&lt;BR /&gt;1) If you append .old to a copy of the crontab file it may cause problems.  Any files in that directory are assumed to be valid crontab files named after a specific user, hence I believe cron will try to run the .old file and will look through /etc/passwd to find the owner (which It will never find.)  This will cause complications if you ever try to trust the system for example.&lt;BR /&gt;&lt;BR /&gt;2) You don't need to remove the edits you made directly to a file if you've already resubmitted using crontab &lt;FILE&gt; as that will have overwritten the original user's crontab.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Darren&lt;/FILE&gt;</description>
      <pubDate>Fri, 08 Aug 2003 08:03:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044430#M135015</guid>
      <dc:creator>Darren Prior</dc:creator>
      <dc:date>2003-08-08T08:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044431#M135016</link>
      <description>I made the changes by doing this:&lt;BR /&gt;&lt;BR /&gt;cd /var/spool/cron&lt;BR /&gt;&lt;BR /&gt;crontab -l&amp;gt;cronfile&lt;BR /&gt;vi cronfile (then saved with wq!)&lt;BR /&gt;crontab cronfile&lt;BR /&gt;&lt;BR /&gt;Then I got this line showing up&lt;BR /&gt;&lt;BR /&gt;"commands will be executed using /usr/bin/sh"&lt;BR /&gt;&lt;BR /&gt;What does the previous line mean?&lt;BR /&gt;&lt;BR /&gt;Also, since one poster said that if you names the file .old then it will be read when cron executes. Well, I now have the file 'cronfile' listed in /var/spool/cron, should I then remove the cronfile now or leave it there? I don't think this should be in /var/spool/cron.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Aug 2003 16:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044431#M135016</guid>
      <dc:creator>Denise_22</dc:creator>
      <dc:date>2003-08-08T16:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Editing crontab files the wrong way...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044432#M135017</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The line about commands being executed by /usr/bin/sh means that your cron jobs will be running under the POSIX shell.  If you wrote and tested your scripts using another shell [Korn, csh, etc.] you might need to try them again using the POSIX shell.  This is just a reminder message. &lt;BR /&gt;&lt;BR /&gt;As for the file in /var/spool/cron, it should be ok. The cron daemon looks for the files in /var/spool/cron/crontabs.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Aug 2003 17:08:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-crontab-files-the-wrong-way/m-p/3044432#M135017</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-08-08T17:08:29Z</dc:date>
    </item>
  </channel>
</rss>

