Cron Job Problems

by 11 replies
13
Hi all

I've been trying to get a cron job to run on the server for a script that my site runs.
According to the script user manual, the command should be this:

wget -q 'hteeteepee://www dot site dot com/system/miscellaneous/task_scheduler/' -o - > /dev/null

It was on the server before but I had to remove it because it seems it was the cause of loads of file dumps in the home directory titled index.html*

Now I need to insert it and some variants are accepted but don't work and others produce Ajax errors and are not accepted.

The site lists properties and sends notifications so I presume the cron is for expiring lthe listings and notifying users and admin of changes ets.
I'm no coder, just a tinker but if anyone can help me out and get this cron to actually run correctly, it will make it feel like Christmas.
#programming #cron #job #problems
  • Remove redirection of output to /dev/null:

    wget -o - -q 'hteeteepee://www dot site dot com/system/miscellaneous/task_scheduler/'

    Or you can try it a different way (this deletes the file right after it retrieves it):

    wget --delete-after -q 'hteeteepee://www dot site dot com/system/miscellaneous/task_scheduler/'
    • [1] reply
    • Hi Steve
      I'll give this command a try and see if it runs it correctly.

      When you say " deletes the file", do you mean the blank index.html files the original command used to dump in the home directory or is it something else?
      Sorry, but I can be quite dense at times, especially anyhting to do with IT
      • [1] reply
  • Ok, one more way for you to try it

    wget -q -O /dev/null hteeteepee://www dot site dotcom/system/miscellaneous/task_scheduler
  • This is another way to do this
    wget -q URL_HERE > /dev/null 2>&1
    • [1] reply
    • Thanks Steve, I'll insert this one now and see if I get any email notification that it works, or am I supposed to receive confirmation as I inserted my email in the cron panel.

      Thanks phpdev. I'll put this one in as well and hope something good happens.
      • [1] reply
  • It all depends on how you're getting the job into the crontab. If you do it thru cPanel (which you might be, judging from your response) you can usually uncheck the 'notify me by email' checkbox.

    Usually (if one can apply that term to anything internet-related) cron puts a notification in your email folder but doesn't actually cause the email to be sent.

    If you have shell access to your hosting account, you might try entering the command by hand. To do that though, you'll need to do some learning on how to use crontab. Lots of Google resources out there.
    • [1] reply
    • Yep, I'm doing through CPanel.
      I activated the email section but I only got a notification for the first command you gave me that dumped the 2 index.html files in the home directory.
      I never got a notification for the second one that had the "delete" function but as you say, maybe it's working although there is no email notification.

      Thanks for all your help Steve.

      It's greatly appreciated.
  • You're welcome, sorry I couldn't get you any further along...

Next Topics on Trending Feed