login community faq

I have the following command in my crontab:

1
0 0,12 * * * /bin/bash -l -c 'cd <omitted>/webapps/craigslist/releases/20120908164349 && RAILS_ENV=production bundle exec rake craigslist:scrape_all --silent >> /tmp/whenever.craigslist.log 2>&1'

Supposedly this command should run every 12 hours, but it hasn't run for days now.

Can my crontab be broken?

asked Sep 08 '12 at 19:27

kennym's gravatar image

kennym
11


Cron jobs generally run on schedule. Most likely the problem is that of cron's environment affecting the operation of this job, causing it to fail when it is run.

To test this, try something like the following to clear your environment and simulate cron's environment:

1
2
3
4
5
6
7
8
9
cd $HOME
unset $(env | awk -F= '/^\w/ {print $1}' | xargs)
USER=<username>
SHELL=/bin/sh
PATH=/usr/bin:/bin
PWD=/home/$USER
SHLVL=1
HOME=/home/$USER
LOGNAME=$USER

And then run the command from within your home directory. Hope that helps!

answered Sep 08 '12 at 23:07

ryans's gravatar image

ryans ♦♦
29461420

Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×58
×37
×9

Asked: Sep 08 '12 at 19:27

Seen: 472 times

Last updated: Sep 08 '12 at 23:07

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited