Solved

Plesk Cron Job - Error

Posted on 2013-05-29
9
1,056 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 6

Expert Comment

by:Robert Saylor
Comment Utility
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
Comment Utility
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 6

Expert Comment

by:Robert Saylor
Comment Utility
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
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 6

Expert Comment

by:Robert Saylor
Comment Utility
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
Comment Utility
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 6

Expert Comment

by:Robert Saylor
Comment Utility
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
Comment Utility
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
Comment Utility
Support fixed issue
0

Featured Post

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

Join & Write a Comment

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

763 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

9 Experts available now in Live!

Get 1:1 Help Now