• Hi all. With the help I’ve found on these forums I’ve been able to set up my blog to takes e-mail posts, but now I’m trying to understand the “cron job” thing. In addition to searching here, I’ve googled the topic as well, but I’m unable to find a very, VERY, elementary overview that might help me accomplish this. For example, I don’t really get what a ‘cron job’ is. Is it a file that I can write in Wordpad and place on my server? And how do I know if my host/database even supports this?

    Sorry for being so new, but if anyone has any guidance they want to suggest that would be great.

    tia!

Viewing 9 replies - 1 through 9 (of 9 total)
  • First link that comes up in Google when searching for “cron”:

    https://www.unixgeeks.org/security/newbie/unix/cron-1.html

    Thread Starter simplecindy

    (@simplecindy)

    Oh heavens I got that days ago. Saved it to my desktop even. Did you read it? I mean all of it? It starts out like exactly like what I need, then quickly devolves into something only a true Unix person would understand. Terribly misleading file, that.

    No, I’m afraid I need something even more basic (if that’s possible). Something that answers questions that I put in my original post. Perhaps there’s nothing out there like that. “Cron” might be one of those things that, well…if you have to ask…

    Anywho, if anyone can give me guidance I’d appreciate it. If not, well I guess I’ll just have to accept it. ??

    Well the thing is that cron is er a Unix programme. Some hosts have a Windows to cron interface which makes it a bit easier. You need to think of it as two steps. All cron will do is to run(execute) at the time you tell it. What it will execute is a script which you need to write and put in an executable file. Taking the second bit first; for auto backup for example you could search for a bash script to export mysql for example. That link is a very good all round primer.

    Surely, (and I’m no Unix geek) the point of a “Cron” is “time”.

    A Unix (any) programme set to run at a given time(s). What it does is whatever the programme does – practically anything – anything you might want to run at a given time.

    Not every webhost allows access to cron. The easiest way to find out if yours does, and how to use it, is to email your webhost’s support.

    If your webhost runs CPanel as your control panel there is usually a ‘Cron Jobs’ link there. It’s a fill out the form type of thing. But your host’s support will clear this up for sure.

    Well to answer part of the question. The script in question you need to write, borrow or adapt is going to be a text thing. We are not talking compiled programmes. It will be a simple script written in text in a text editor. Wordpad is fine. With the correct incantantion that script will become an executable file or a small programme. Next up it needs to be placed in the proper file path. Then you tell Cron that at the time selected to run the programme. What the script does is up to you. It can be quite fancy. Typically it will end by sending you an email telling you it has done its stuff. PERL is commonly used to write text handling programmes or a shell like BASH or something. But it could be php.

    Thread Starter simplecindy

    (@simplecindy)

    Thank you guys (particularly Root) for all the info. Armed with your good explainations and advice I’ve sent off a support question about cron scipts to my host. We’ll see if this is something I can do.

    Thanks again for the support. I think what makes WP so great is the user base!

    Cron is normally bundled with another app called crontabs as well. Keep an eye out it is very handy. Could you give us a clue as to what this script is going to do?

    Careful about the cron jobs your run btw, many hosts find that regular cron jobs by users can eat up badnwdith and resources and can suspend an account on this basis. Most use it for a weekly backup or for stage by stage installations, but hopefully your host will explain the process. It’s a very handy system if used right.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘“Cron Job” for Dummies??’ is closed to new replies.