WebFaction
Community site: login faq

I have the following command in my crontab:

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 08 Sep '12, 19:27

kennym
1123
accept rate: 0%


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:

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!

permanent link

answered 08 Sep '12, 23:07

ryans ♦♦
5.0k93360
accept rate: 43%

Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×103
×50
×17

question asked: 08 Sep '12, 19:27

question was seen: 2,781 times

last updated: 08 Sep '12, 23:07

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM