Solved

Crontab doesn't work

Posted on 2013-01-03
8
754 Views
Last Modified: 2013-01-03
Errors below are on the logs.

dsn=2.0.0, status=sent (delivered to mailbox)
Jan  3 12:32:01 ubuntu postfix/qmgr[8039]: 8900D291A2FC: removed
Jan  3 12:32:06 ubuntu crontab[15790]: (root) LIST (root)
Jan  3 12:33:01 ubuntu CRON[15792]: (root) CMD (lynx -dump http://www.url.com/run.php)
Jan  3 12:33:01 ubuntu CRON[15791]: (CRON) error (grandchild #15792 failed with exit status 127)
Jan  3 12:33:01 ubuntu postfix/pickup[15581]: 959BB291A2FD: uid=0 from=<root>
Jan  3 12:33:01 ubuntu postfix/cleanup[15637]: 959BB291A2FD: message-id=<20130103103301.959BB291A2FD@ubuntu>
Jan  3 12:33:01 ubuntu postfix/qmgr[8039]: 959BB291A2FD: from=<root@ubuntu>, size=526, nrcpt=1 (queue active)
Jan  3 12:33:01 ubuntu postfix/local[15639]: 959BB291A2FD: to=<root@ubuntu>, orig_to=<root>, relay=local, delay=0.13, delays=0.09/0/0/0.04,

Open in new window

0
Comment
Question by:ahmettiryaki
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 37

Accepted Solution

by:
Neil Russell earned 250 total points
ID: 38739613
specify the FULL PATH to the lynx executable.
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 38739624
Agree with comment above, can you post the CRON entry as well?

Perhaps there are more errors there that we could help you with.
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 38739639
Hi,

Status 127 means there's a path not found error condition in your script. When executing cron scripts you need to add full path to commands because cron Environment is not the same as your ilogon environment.

Here's a list of exit status codes for cron scripts:

Script Exit Codes

Cheers,
K.
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38739661
So like I said in the First post. Specify the FULL PATH to lynx
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:ahmettiryaki
ID: 38739666
I have 3 different tasks, none of them worked.

*/1 *   *   *   *  run1.php
*/1 *   *   *   *  php run2.php
*/1 *   *   *   *  lynx -dump http://www.url.com/run3.php

Open in new window

0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38739675
*/1 *   *   *   * /usr/bin/lynx -dump http://www.url.com/run3.php

Or wherever the lynx binary exists
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 38739679
Hi Ahmet Bey,

Then you need to enter full path for all the commands and any paramaters specifying a file to access.. such as:

*/1 *   *   *   *  /path/to/run1.php
*/1 *   *   *   *  /path/to/php /path/to/run2.php
*/1 *   *   *   *  /path/to/lynx -dump http://www.url.com/run3.php

Open in new window


Cheers,
K.
0
 

Author Comment

by:ahmettiryaki
ID: 38739722
Thank you all for the answers.

I installed Lynx again and problem solved.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now