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

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



"Axel Denk" <cobaltlist@xxxxxxxx> wrote:
> (1) I have two files now:
>
> [admin cron.daily]$ ls -all test.*
> -rwxr-xr-x   1 root     root           96 Apr 21 23:12 test.cron
> -rwxr-xr-x   1 root     root          261 Apr  7 18:11 test.sql
>
> (2) test.cron looks like that:
>
> [admin cron.daily]$ cat test.cron
> #!/bin/sh
> /usr/bin/mysql --user=test --pass=test < /etc/cron.daily/test.sql

If you look at the contents of /etc/crontab you'll see that all all files
within /etc/cron.daily/ are executed once per day.  You do not want to
execute test.sql.  What you want to do is execute test.cron with test.sql
directed to mysql as text input.  Move test.sql to a location not inside a
/etc/cron.x/ directory and change the path in test.cron and it will work
fine.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/