[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Plesk Cron Job - Error

Posted on 2013-05-29
9
Medium Priority
?
1,136 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 111

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

649 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