PDA

View Full Version : Cron Newbie



glen1001
07-11-2006, 01:16 PM
Hello,

I've been reading a bunch of stuff on CRON (I've never done one cron in my life ) I think I basically understand it except for one thing. How do I start? I mean just start. Do I just upload a file with the command to start the cron? It sounds like some of you are accessing some interface (telnet? (How do I "telnet into my server"?, openSSH? --- like terminal on Mac) Do I just upload files with the code in it? Seems like all the tutorials assume I'm already in some editing environment that has access to the server. How do I get there? I work on a Mac (OS X).

Glen

torrin
07-11-2006, 02:18 PM
You need to login to your server using ssh or telnet. (ssh is preferred) Then type editcron -e to edit your cron file. Let me give you an example. I'm not really sure if this works on Mac OS X or not so your mileage my vary.


Drop into a command line on your computer (don't know how to do this on Mac OS X)
type ssh username@example.com (replace username with your user name and replace example.com with your domain name)
type in your password when it asks
at this point you should be logged in
type editcron -e (this command will edit your cron file)

wildjokerdesign
07-12-2006, 08:17 AM
Here is the link to the WestHost manual area that explains the basics of SSH.
http://members.westhost.com/ssh-manual.html

They mention Putty and I belive that it will run on Mac OS.

glen1001
07-12-2006, 09:01 AM
I work on a Mac and the Terminal program works fine for this. Apparently Mac OS 10 comes with ssh installed. Thanks again. Everything I read just assumed I knew this and hence I couldn't get started. No doubts I'll have some other problems but I least, thanks to your help, I can get started.

Regards,

Glen

glen1001
07-13-2006, 09:32 AM
The first time I accessed my site via:

ssh username@mysite.com

and entered the password. Everything worked fine. Great. Then I figured out all the cron stuff and was going to enter it in. When I attempted access and entered the password I kept getting:

Permission denied, please try again.

I get this message repeatedly until I get this one:

Permission denied (publickey,password,keyboard-interactive).

Have no idea what to do at this point.

Glen

glen1001
07-13-2006, 11:45 AM
Also tried to access from my Windows computer. No luck. Same message.

wildjokerdesign
07-13-2006, 01:34 PM
Go ahead and submit a support ticket to WH letting them know that you are not able to log in to SSH. Today I am haveing a problem logging in to one of my accounts and have contacted them about it. I think there is something going on at the server level today perhaps. :)

glen1001
07-14-2006, 08:58 AM
Turns out my username (my email address) which is: mysite@mysite.com that I use as my username to ftp does not work in the SSH syntax. I was using:

ssh mysite@mysite.com@mysite.com

Now I use:

ssh mysite@mysite.com

And when prompted for password - it works.

Couple of newbie questions on the cron:

I'm assuming I can enter several cron commands when I do editcron -e? I.e.:

30 * * * * * usr/local/bin/php -q var/www/html/semnews/admin/cron.php
30 * * * * * usr/local/bin/php -q var/www/html/semnews/admin/cron2.php

Secondly, I noticed from the command line edit mode it gives the exact location of the file where these cron commands are located. Is there any reason why I cannot download that file, edit it in my text editor and upload it via ftp?

Regards,

Glen

jalal
07-14-2006, 12:07 PM
Secondly, I noticed from the command line edit mode it gives the exact location of the file where these cron commands are located. Is there any reason why I cannot download that file, edit it in my text editor and upload it via ftp?

In theory, yes you can. But you'll find that cron is setup the way it is for security reasons, and if you don't know what you are doing you will end with a broken cron. This is almost certain if you are using a Windows computer to edit it in.

HTH

torrin
07-14-2006, 12:14 PM
I'm assuming I can enter several cron commands when I do editcron -e? I.e.:

30 * * * * * usr/local/bin/php -q var/www/html/semnews/admin/cron.php
30 * * * * * usr/local/bin/php -q var/www/html/semnews/admin/cron2.php

Secondly, I noticed from the command line edit mode it gives the exact location of the file where these cron commands are located. Is there any reason why I cannot download that file, edit it in my text editor and upload it via ftp?

Yes, you can enter several cron commands at once. You enter them just like you have above in your post.

To answer your second question, downloading, editing and uploading via ftp will probably work OK, but I can't advise it since I haven't tried it.

glen1001
07-15-2006, 01:21 PM
Thanks for all the help from everybody, including Mark C., the tech who helped via email. I truly appreciate it. Couldn't have done it without your help. Cheers!