[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Plesk Cron Setup

Posted on 2011-02-17
9
Medium Priority
?
978 Views
Last Modified: 2012-08-13
Hello,

I have a cron setup and it will work only if the action only takes a couple seconds but if it takes about 10 minutes to complete the action it does not complete it.

Here is what I am using:
/usr/bin/wget "http://www.dmain.com/insert.php"
0
Comment
Question by:movieprodw
  • 5
  • 4
9 Comments
 
LVL 5

Expert Comment

by:jason987
ID: 34919596
Cron does not wait for applications to execute it just fires them off and moves on.

I think wget has a default timeout but I can't remember or find out what it is at the moment, you could set it in your command though:

--timeout=seconds
0
 
LVL 1

Author Comment

by:movieprodw
ID: 34920478
Is there something other than wget that I can use that will not timeout?
0
 
LVL 5

Expert Comment

by:jason987
ID: 34920575
Setting the timeout to 0 disables it.  

If you are just looking to try somethign else curl is pretty popular for silent http transfers.

http://en.wikipedia.org/wiki/CURL
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 1

Author Comment

by:movieprodw
ID: 34920851
so I would go like this?

/usr/bin/wget "http://www.dmain.com/insert.php" --timeout=0
0
 
LVL 5

Accepted Solution

by:
jason987 earned 2000 total points
ID: 34920901
I don't know if it makes a difference in wget/version but the option switches come before the target:

/usr/bin/wget  --timeout=0 "http://www.dmain.com/insert.php"
0
 
LVL 5

Expert Comment

by:jason987
ID: 34920912
But yes, that sets it to wait forever.  Personally I don't like saying "forever" (in code) so I would just set something extremely high.
0
 
LVL 1

Author Comment

by:movieprodw
ID: 34920943
Okay, I am guessing it is in seconds so maybe I can set it to 2 hours or something, so I would go...


/usr/bin/wget  --timeout=7200 "http://www.dmain.com/insert.php"

... is that correct?
0
 
LVL 5

Expert Comment

by:jason987
ID: 34921015
Yes.  My rule is to always test a command as a last step before copying it into cron.  It's a pain to have something go crazy at 1am.
0
 
LVL 1

Author Closing Comment

by:movieprodw
ID: 34921070
Thank you
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month19 days, 1 hour left to enroll

834 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