Putty Tutorials - Please share them

Re: Putty Tutorials - Please share them

by Mark Hughes -
Number of replies: 0

Just out of curiousity who is your webhost?  I only ask because if you've got someone like dreamhost, and you get ahold of the right fella in tech support, they sometimes help with setting up cron tasks.  Also, be careful with what you're running and how often you run it.  Running a server task every minute or so tends to anger the guy, from high atop the thing.

     Also, know that putty is just a terminal -- it doesn't do anything you couldn't do with telnet or hyperterminal, or for that manner a properly hacked speak-'n-spell...once you log on, you basically are just using your keyboard and screen on a computer that is far, far away.  You might have better luck doing a search on "crontab" for setting up the cron process than on "pico"

There are good instructions for doing this at http://moodle.org/doc/?file=install.html down towards the bottom of the page.  (where incidentally I stole the cron task from).  So assuming you tried what was written in the install manual and were stimied by vi, let me try it in another popular program called pico

As far as all that goes, assuming you have crontab, and a basic text editor like pico (once you log in type pico and hit enter, if a text editor comes up, you're good to go -- if it says command not found, well, you might have to try another post)

Start by creating some arbitrary file to house your task -- here it'll be mycron

type:  touch mycron

Now edit it in pico or some other editor

Type:  pico mycron

Then a carriage return to get to a newline where we'll use wget to access the page.  And unless you want an email every five minutes from the server sharing with you the joys and sorrows that come from relentlessly running your task, be sure to include the mailto command or some variant.  Maybe send it to someone who has wronged you in the past by forwarding you some megabyte sized chain letter about some lawyers in Alabama who didn't answer it and the next day he was gored by a unicorn.  Trust me, a nice error-ridden email every five minutes, and they'll learn to use spam filters in a hurry, or they won't....either way, it'll be a learning experience.  And who can't benefit from education?

Type:  Mailto = ""

then the following all on one line

*/5 * * * * wget -q -O /dev/null http://example.com/moodle/admin/cron.php

now close pico by typing [Ctrl][x]

say [y] you do want to save the file

pick a filename, for this example it is "mycron"

hit [enter]

and then we'll load it by typing one final line

crontab mycron

now if you ever want to view what tasks are running

type crontab -l

If you ever want to stop it all together (careful, this deletes it)

type crontab -r

And if you'd just like to edit it in the default editor

type crontab -e

Or type pico mycron  , save it and then type crontab mycron to replace you old tasks.

Hope this helps and above all, I hope I didn't accidentally lie to you.  If you're still having troubles I'd be happy to sit in a chat with you while we walk you through it.  Good luck!

Mark

Average of ratings: Useful (1)