[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: AW: [cobalt-users] Problems with cronjob



AD> Date: Mon, 22 Apr 2002 10:12:58 +0200
AD> From: Axel Denk <cobaltlist@xxxxxxxx>


AD> /etc/cron.daily/test.cron -u test -p test < /etc/cron.daily/test.sql
AD> 
AD> The error I get is that:
AD> 
AD> /etc/cron.daily/heissnerinfo.sql: connect: command not found
AD> /etc/cron.daily/heissnerinfo.sql: DELETE: command not found
AD> /etc/cron.daily/heissnerinfo.sql: LOAD: command not found

Looks like the SQL file was being parsed as a shell script.
Brent said to create a shell script... i.e., create a file
called "test.sh" that contains:

	#!/bin/sh
	/path/to/mysql -u user -p passwd < /path/to/test.sql

and then execute said shell script.  That'll let you test your
SQL script.

Another approach is to redirect IO using the pipe character; I
personally tend to do this:

	cat /path/to/test.sql | /path/to/mysql -u user -p

This will prompt for password, so I needn't store a plaintext
password on disk for even a second.  Excessive paranoia, perhaps,
but there's no harm in that.


AD> Someone has any other advice?

	man crontab

will give info on your original question of how to put a job in
cron.  You might want to make friends with vi or change your
default editor... although perhaps painful, I suggest the latter;
vi is pretty universal, and good to know.  [I'm far from fond of
it, and say that it's short for "vile", but I use it frequently.]


AD> Thanks and best regards,
AD> 
AD> Axel


--
Eddy

Brotsman & Dreger, Inc. - EverQuick Internet Division
Phone: +1 (316) 794-8922 Wichita/(Inter)national
Phone: +1 (785) 865-5885 Lawrence

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Date: Mon, 21 May 2001 11:23:58 +0000 (GMT)
From: A Trap <blacklist@xxxxxxxxx>
To: blacklist@xxxxxxxxx
Subject: Please ignore this portion of my mail signature.

These last few lines are a trap for address-harvesting spambots.
Do NOT send mail to <blacklist@xxxxxxxxx>, or you are likely to
be blocked.