Solved

Plesk Cron Job - Error

Posted on 2013-05-29
9
1,082 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 110

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

726 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