Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Nov 04, 2010 8:12 am 
Offline
Newbie

Joined: Fri Jul 23, 2010 6:09 am
Posts: 4
Hello,

I have a rails application and trying to setup the cronjob to send out the emails.

Here is my Cronjob,

20 9 * * * /bin/sh -c "cd /srv/www/rails_app_directory && RAILS_ENV=development /usr/bin/env rake email:send_signup_email >> /srv/www/rails_app_directory/log/cron_log.log 2>&1"

When I try this, I get an Error.

Error Message:

/usr/bin/env: rake: No such file or directory

Looks like the Path problem. Any help would be appreciated.

Thanks,
Muni.


Top
   
 Post subject:
PostPosted: Sun Nov 14, 2010 9:31 am 
Offline
Senior Newbie

Joined: Wed Apr 28, 2010 6:23 am
Posts: 10
Don't do this. Create a ~/bin directory, make a shell script that does everything you want it to, and have cron execute it. Bear in mind that cron doesn't do proper variable substitution and sets a limited PATH (which is why it can't find rake in the path). See crontab(5) manpage for details.

Also, don't append directly to log file. Use a pipe agent that supports rotation.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group