Solved

Plesk Cron Setup

Posted on 2011-02-17
9
959 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 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

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

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…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 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