WebFaction
Community site: login faq

i have a cronjob scheduled which is supposed to update a file. Unfortunately the file doesn't get updated. For this reason I am trying to debug it. In my crontab now I have:

*/5 * * * * ~/scripts/my_script.sh >> ~/webapps/my_app/logs/cronjob.txt 2>&i

The log file got created but it's empty, and the file which is supposed to be updated by the cronjob is still not updated.

What should I do next to debug it?

For reference my script basically contains:

cd /home/my_user/webapps/django_app/myproject
/usr/local/bin/python2.7 manage.py my_command

if I run the script directly from terminal, it works.

asked 12 Nov '12, 11:40

gabon
1538
accept rate: 0%

edited 12 Nov '12, 16:27

seanf
12.2k31836


Your stderr redirect is not correct. You're using "2>&i" when instead you should be using "2>&1".

Hope that helps!

permanent link

answered 12 Nov '12, 16:50

seanf
12.2k31836
accept rate: 37%

Thanks, I am giving it a go! :)

(14 Nov '12, 04:00) gabon

Ah, I get: /bin/sh: /home/my_user/scripts/my_script.sh: No such file or directory

(14 Nov '12, 04:34) gabon

And indeed, I had a typo in the script name! :S Thanks!

(14 Nov '12, 04:38) gabon
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:

×905
×50
×23
×17

question asked: 12 Nov '12, 11:40

question was seen: 1,709 times

last updated: 14 Nov '12, 04:38

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