by Juba1
11 replies
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.
#cron #job #problems
  • Profile picture of the author SteveJohnson
    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/'
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3562860].message }}
    • Profile picture of the author Juba1
      Originally Posted by SteveJohnson View Post

      Remove redirection of output to /dev/null:

      wget -o - -q 'hteeteepee://www dot site dot com/system/miscellaneous/task_scheduler/'
      Hi Steve
      I'll give this command a try and see if it runs it correctly.

      Originally Posted by SteveJohnson View Post

      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/'
      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
      {{ DiscussionBoard.errors[3562923].message }}
      • Profile picture of the author SteveJohnson
        Originally Posted by Juba1 View Post

        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
        No problem - wget actually retrieves the specified file and stores it. That's what it's for. So if you were to open up the 'index.html' file that it retrieves, you'd see the page code.
        Signature

        The 2nd Amendment, 1789 - The Original Homeland Security.

        Gun control means never having to say, "I missed you."

        {{ DiscussionBoard.errors[3563177].message }}
        • Profile picture of the author Juba1
          Hey Steve

          Just wanted to let you know how the cron issue went.
          I set up both to receive email notifications and this is what I got.
          The first one you gave me sent the following notification:

          --2011-03-20 12:00:02-- hteeteepee://www dot site dotcom/system/miscellaneous/task_scheduler
          Resolving www dot site dot com... 69.65.3.219
          Connecting to www dot site dot com|69.65.3.219|:80... connected.
          HTTP request sent, awaiting response... 200 OK
          Length: 0 [text/html]
          Saving to: `task_scheduler'

          0K 0.00 =0s

          2011-03-20 12:00:06 (0.00 B/s) - `task_scheduler' saved [0/0]


          I checked the Home directory and sure enough there were 2 files added titled "index.html" which I then deleted.

          The second one did not send an email notification so not sure if that means it's not working?

          Not really sure where to go from here and what command to use so that it works and stops sending files to directory as well.

          So sorry for asking for help again.
          {{ DiscussionBoard.errors[3566427].message }}
  • Profile picture of the author SteveJohnson
    Ok, one more way for you to try it

    wget -q -O /dev/null hteeteepee://www dot site dotcom/system/miscellaneous/task_scheduler
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3567610].message }}
  • Profile picture of the author phpdev
    This is another way to do this
    wget -q URL_HERE > /dev/null 2>&1
    Signature
    Ali Usman
    PHP, MySql, WordPress, API Programming, E-Commerce Site, Payment Integration, Twilio, SMS Marketing, Custom Development, Wordpress, Joomla, Interspire, BigCommerce, Volusion, 3dCart and many more...
    sales@bluecomp.net
    {{ DiscussionBoard.errors[3567837].message }}
    • Profile picture of the author Juba1
      Originally Posted by SteveJohnson View Post

      Ok, one more way for you to try it

      wget -q -O /dev/null hteeteepee://www dot site dotcom/system/miscellaneous/task_scheduler
      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.

      Originally Posted by phpdev View Post

      This is another way to do this
      wget -q URL_HERE > /dev/null 2>&1
      Thanks phpdev. I'll put this one in as well and hope something good happens.
      {{ DiscussionBoard.errors[3569033].message }}
      • Profile picture of the author Juba1
        Well guys thanks for taking the time in trying to help me out but the panel would not accept the last two commands.
        Just out of interest Steve, should I expect to receive an email notification when the cron command you gave me below is run?

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

        Thanks
        {{ DiscussionBoard.errors[3569073].message }}
  • Profile picture of the author SteveJohnson
    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.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3570444].message }}
    • Profile picture of the author Juba1
      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.
      {{ DiscussionBoard.errors[3570637].message }}
  • Profile picture of the author SteveJohnson
    You're welcome, sorry I couldn't get you any further along...
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3570660].message }}

Trending Topics