Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Nov 2000 20:08:41 +0000
From:      ark <ark@pc759.cs.msu.su>
To:        alum.mit.edu!cjclark@pc759.cs.msu.su
Cc:        Steve Price <hiwaay.net!sprice@pc759.cs.msu.su>, FreeBSD.ORG!freebsd-questions@pc759.cs.msu.su
Subject:   Re: 'crontab -e' woes
Message-ID:  <3A01C9C9.4BEB1865@pc759.cs.msu.su>
References:  <20001101210426.A57642@bsd.planetwe.com> <20001101234720.J75251@149.211.6.64.reflexcom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp;
<p>"Crist J . Clark" wrote:
<blockquote TYPE=CITE>On Wed, Nov 01, 2000 at 09:04:26PM -0600, Steve Price
wrote:
<br>> Howdy all,
<br>>
<br>> Don't know if it is just a couple of days of absolutely no
<br>> sleep or what but I've been scratching my over head what
<br>> should be a simple problem.
<br>>
<br>> Basically what I'm trying to do is setup a non-interactive
<br>> script that edits my crontab.&nbsp; When I type the following
<br>> commands in it comments out the first entry.&nbsp; However, when
<br>> I run it by redirecting stdin from a file it doesn't work.
<br>> >From the looks of it (note the 37 -> 38 change) the file
<br>> is being updated but crontab is ignoring the change.
<br>></blockquote>
May be, you choose wrong method to do; if you need from time to time do
something with
<br>1 second intervals you'll be better run script with 'sleep 1' command
in it and internal counter.
<blockquote TYPE=CITE>&nbsp;
<br>> steve@bsd(/tmp)$ crontab -l
<br>> # DO NOT EDIT THIS FILE - edit the master and reinstall.
<br>> # (/tmp/crontab.teFMi62568 installed on Wed Nov&nbsp; 1 20:47:27
2000)
<br>> # (Cron version -- $FreeBSD: src/usr.sbin/cron/crontab/crontab.c,v
1.12 1999/08/28 01:15:52 peter Exp $)
<br>> */1&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /home/steve/bin/bogus.sh
<br>> steve@bsd(/tmp)$ cat cmds
<br>> 1s/^/#/
<br>> wq
<br>> steve@bsd(/tmp)$ env VISUAL=/bin/ed crontab -e &lt; cmds
<br>> 37
<br>> 38
<br>> crontab: no changes made to crontab
<br>> steve@bsd(/tmp)$ cat cmds | env VISUAL=/bin/ed crontab -e
<br>> 37
<br>> 38
<br>> crontab: no changes made to crontab
<br>> steve@bsd(/tmp)$
<br>>
<br>> Can anyone tell what I'm doing wrong?&nbsp; Thanks.
<p>Don't ask me why, but try this,
<p>&nbsp; $ { echo '1s/^/#/'; echo w; } | env VISUAL=/bin/ed crontab -e
<p>And see what happens. (Just lost the 'q.')
<br>--
<br>Crist J. Clark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cjclark@alum.mit.edu
<p>To Unsubscribe: send mail to majordomo@FreeBSD.org
<br>with "unsubscribe freebsd-questions" in the body of the message</blockquote>
</html>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A01C9C9.4BEB1865>