Solved

Plesk Cron Job - Error

Posted on 2013-05-29
9
1,069 Views
Last Modified: 2013-06-14
Hi guys,

I'm trying to use a Cron Job through Plesk to execute a PHP script on my server. The job is set to run every 60 seconds, and send me an email when it does.

That part seems to be working correctly, and I am receiving an email every 60 second. However, the email contains the following:

"user with id=10263 and name=shareafi not found in chrooted passwd file
system error: No such file or directory"

Here's the argument that i'm using:

/usr/bin/wget  --timeout=0 "http://www.shareafile.co.uk/Code/clean_up.php "

I've tried various different arguments, but I get the same result each time.

Any thoughts?
0
Comment
Question by:gesmuk
  • 4
  • 4
9 Comments
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39204740
Your user might not have access to wget. You might need to add wget to your sudo with the UID.

IE: visudo

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
yourusername ALL=NOPASSWD: /bin/wget

Then call it /usr/bin/sudo /bin/wget in your cron.
0
 

Author Comment

by:gesmuk
ID: 39204749
I'm embarressingly going to sound like a real noob here and ask, where do I run this?

I'm not massively familiar with Unix. Do I run this from within Plesk somewhere?
0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39204758
You will need to use SSH. Download putty. Note: Plesk uses a sudo envirement unlike WHM/cPanel. You will have to ssh in as "admin" then su - as root. It's 2 different passwords on Plesk.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39204792
Scripts that test out correctly as web pages may not work the same way when started as CRON jobs.  The PHP and SQL environments are usually different.  It's always something of a research project to discern the differences, and this is how I usually start.

1. Run this script, shown here in its entirety as a web page and print the output document.
<?php phpinfo();

Open in new window

2. Install this script as the CRON job and wait long enough for it to be triggered.  You should receive an email message.
<?php
ob_start();
phpinfo();
$msg = ob_get_clean();
mail('You@Your.Org', 'CRON Info', $msg);

Open in new window

3. Compare the phpinfo() data from the web page and the CRON.  Plan on this taking a while; most likely the information you need is near the bottom of the rather large jumble of output.  Adjust the CRON PHP script variables as needed to make the PHP script work.  You will probably find dependencies on things like DOCUMENT_ROOT and the paths to the SQL servers.
0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39204807
If you are not familiar with SSH I would ask your dedicated server hosting company to make the change to visudo. It is a 5 second job and most would not charge for small modifications. Once your cron job executing as the "plesk" user has permission to the command "wget" it should operate with no issues.

From my experience with plesk this is the issue.
0
 

Author Comment

by:gesmuk
ID: 39205036
Thanks guys,

Seeing as this seemed to be account related, I logged into Plesk under a different account and set up the Scheduled Task again.

This time, I'm getting a different error message on the email

" PHP: command not found"

After a bit of googling, it seems as though it's another command that I have to run through SSH to resolve this...?

However, it does appear as though I don't have access to SSH on the server
0
 
LVL 7

Expert Comment

by:Robert Saylor
ID: 39207471
Do you have root access? If you own the dedicated server you should. The default SSH port of 22 might not be the SSH port. You would want to open a ticket with your dedicated server provider for instructions to SSH into your server. If you are on a shared plan or a reseller plan you won't have this access and you would need to request your host for assistance. Note: Your host won't allow this on a shared server. This is usually a dedicated server option.

Note: Check out WHM/cPanel. It is much better then Plesk and the license fee's is about the same amount.
0
 

Accepted Solution

by:
gesmuk earned 0 total points
ID: 39233984
Thanks guys, a support ticket raised with the host managed to get it resolved. Though unfortunately I don't know what the fix actually was :(
0
 

Author Closing Comment

by:gesmuk
ID: 39247026
Support fixed issue
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Shopping Cart 2 71
php simple error message 4 23
Query still returning duplicates 5 29
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 33
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
The viewer will learn how to count occurrences of each item in an array.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

773 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