WebFaction
Community site: login faq

I've written a bash script which calls a few PHP scripts with sleep() intervals between them. I've tried calling the bash script from command line, and it works great.

However, when I try to set up a cron job to run the bash script every minute, nothing happens. This is what my crontab looks like:

* * * * * /home/{username}/webapps/scrapper/bash.sh

When executing ./bash.sh from /webapps/scrapper/, everything works fine.

asked 12 Dec '11, 05:44

Wrks
748
accept rate: 0%


Hi,

Cronjobs run under a different environment, so it's possible that a different env variable is causing this. To investigate this, please try redirecting the stdout and stderr for your script to a file, such as:

 * * * * * /home/{username}/webapps/scrapper/bash.sh >~/cronoutput.txt 2>&1

If this doesn't help you resolve the problem, please open a ticket, and we'll take a look at it for you.

permanent link

answered 12 Dec '11, 05:52

todork
1.2k4
accept rate: 34%

It helped, thanks! I was using only "php" instead of "/usr/local/bin/php".

(12 Dec '11, 06:02) Wrks
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:

×81
×23

question asked: 12 Dec '11, 05:44

question was seen: 3,775 times

last updated: 12 Dec '11, 06:02

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