Welcome Guest | Login

trouble running rake as a cron task

I'm running the following cron job:
cd rails_app/lib/tasks && rake rake_task_name

and I receive the following cron notification:
/bin/sh: rake: command not found

When I ssh into the server, I'm able to run rake with no problem.

Any ideas?

2008-04-06 10:28 AM

Could you try /usr/local/bin/rake instead of rake ?

2008-04-06 10:49 AM

Santhi,

I tried that, and now this is what I'm getting:
rake aborted!
Access denied for user 'root'@'localhost' (using password: NO)

(See full trace by running task with --trace)
(in /home/username/...)

2008-04-07 09:41 AM

Did you configure your database.yml properly?

2008-04-07 10:32 AM

The database.yml is configured so that the rails app can access the database, yes.

The message I'm getting above, I think says that the cron job is being run as 'root' and that it doesn't have the right permissions.

Any ideas?

2008-04-09 11:19 AM

I have modified your cronjob and now it seems to be working fine. Please check and confirm.

2008-04-09 08:05 PM

I see that the rails environment had to be specified. The command is working properly now.

However, looking at the log for one of my cron jobs, I'm getting:
rake aborted!
execution expired

Is this because it took too long? Is there a way for me to get around this?

2008-04-10 07:49 AM

Hi - Please post a ticket to the support with this error messages. Also please update the path to the logs so that we can check this and get back to you. Thank you

2008-04-10 01:19 PM

HostingRails Support

Hello Guest! In order to post you must be an active client with us, please log in or sign up.