[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Problems with cronjob
- Subject: Re: [cobalt-users] Problems with cronjob
- From: Jeffrey April <jeff@xxxxxxxxxx>
- Date: Fri Apr 19 08:27:28 2002
- Organization: NetGenesis
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
One common difference with running scripts from the command prompt and from cron
is that the environment settings are different. Cron only has access to a
skeleton of env variables, so your mysql command might not be in the path. One
thing to try would be to add the full path to the commands that you are
passing. For example, change 'mysql' to '/usr/local/bin/mysql' or what ever the
correct path is. If you are not sure what the full path is, use the 'which'
command (which mysql) and that should tell you.
Jeff
> Message: 16
> From: Axel Denk <cobaltlist@xxxxxxxx>
> To: <cobalt-users@xxxxxxxxxxxxxxx>
> Date: Fri, 19 Apr 2002 11:34:08 +0200
> Subject: [cobalt-users] Problems with cronjob
> Reply-To: cobalt-users@xxxxxxxxxxxxxxx
>
> Hello,
>
> I tried to install a crontab job for updating a mysql table.
>
> So I wrote a small test.cron located in /etc/cron.daily :
>
> cd /etc/cron.daily
> mysql --user=test --pass=test < test_sqlcommand
>
> Also, I wrote a small file called test_sqlcommand, also located in
> /etc/cron.daily :
>
> connect testdb
> DELETE FROM testProducts;
> LOAD DATA LOCAL INFILE
> '/home/sites/www.test.de/users/testuser/testproducts.csv'
> REPLACE INTO TABLE testProducts FIELDS
> TERMINATED BY ';' ENCLOSED BY '\"' ESCAPED BY '\\' LINES TERMINATED BY
> '\n'
> \g
> \q
>
> When I ssh the box and run the test.cron, everything works fine. But
> when the machine tries to do the cronjob, I get the following message:
>
> /etc/cron.daily/test.cron: test_sqlcommand: No such file or directory
> /etc/cron.daily/test_sqlcommand: connect: command not found
> /etc/cron.daily/test_sqlcommand: DELETE: command not found
> /etc/cron.daily/test_sqlcommand: LOAD: command not found
> /etc/cron.daily/test_sqlcommand: REPLACE: command not found
> /etc/cron.daily/test_sqlcommand: TERMINATED: command not found
> /etc/cron.daily/test_sqlcommand: g: command not found
> /etc/cron.daily/test_sqlcommand: q: command not found
>
> I really don't know what to do anymore. If anyone has any suggestion, I
> would really appreciate this.
>
> Thanks for you help,
>
> Axel Denk
>
> --__--__--
--
_____________________________________________________
@a=split(/X*/," ,JPacehklnorstu");print@a[2,15,13,14,
0,4,10,11,14,7,6,12,0,3,6,12,9,0,7,4,5,8,6,12,1];
=====================================================
Jeffrey April Email: jeff@xxxxxxxxxx
Senior Consultant URL: http://www.netgen.com
Tel: +1.858.488.4394
808 Monterey Court Cel: +1.619.994.3330
Mission Beach, CA 92109 Fax: +1.801.996.1733