Solved

Plesk Cron Setup

Posted on 2011-02-17
9
952 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
 
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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 5

Accepted Solution

by:
jason987 earned 500 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 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

10 Experts available now in Live!

Get 1:1 Help Now