help with 'cron'

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Thu Apr 14 18:56:37 UTC 2005


On Thu, Apr 14, 2005 at 01:08:35PM -0400, Madison Kelly wrote:
>   I am going slightly mad here trying to get 'cron' working. I've read 
> a fair bit on cron, I am more or less sure I've got the syntax right, 
> but it just won't run. I've even looked at working crontab files...
> 
>   I am trying to run a perl script (eventually) and a bash script (for 
> testing). At this point I have a very simple perl script that reads what 
> command line switches it was passed and prints it out. When it tries to 
> run it though I get an invalid terminal error. So I decided to try 
> calling it through a shell script with 'export TERM=xterm' and that 
> worked a couple of times but now it doesn't.
> 
>   I've tried having cron email me but it doesn't want to do that, 
> either. I have even tried redirecting the scipt output to a file just to 
> see if it's running but nothing there, either.
> 
>   All I want to do is have cron call a perl script with certain 
> switches at a given time... As I understand this is what cron should be 
> really good at. So I've created this file:

Some hints about cron:

Everything run in cron has:

No PATH by default.  Use explicit paths to all commands or add a PATH to
your script.

No terminal (it isn't running on a tty so don't try to do anything that
requires a tty to exist).  stdout/stderr are logged and mailed if any
output occours.  Interactive programs won't work.  If they need a tty,
sometimes you can use screen in interesting ways to fake one but I am
not sure about that one.

Also:

The crontab should end in a blank line to ensure that each line you care
about ends in a linefeed, since cron demands all lines end in a linefeed
or they are ignored.

Maybe that helps a little.

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list