PDA

View Full Version : anyone here knows SSH or telnet?



harrylmh
March 7th, 2001, 08:24
I need to use SSH to crontab a file. I downloaded the software, Putty to SSH. But I don't know how to navigate when I'm in. If anyone knows telnet/SSH please help me.

I need to crontab a file in a directory. How to I get into that directory. What should I type?

Thank you.

atlas
March 8th, 2001, 12:24
Originally posted by harrylmh
I need to use SSH to crontab a file. I downloaded the software, Putty to SSH. But I don't know how to navigate when I'm in. If anyone knows telnet/SSH please help me.

I need to crontab a file in a directory. How to I get into that directory. What should I type?

Thank you.

Just SSH or telnet in and run this command:


crontab -e


Then use vi to edit the file.... :)

Or, if you don't use vi and you have a bash shell do


export EDITOR=pico

(replace pico with any other editor you like)
before you do the crontab command posted earlier.

Once in the file add the entry. I'm guessing they at least provided basic information about crontab files? or do I need to explain the format too?

[ I suggest having someone else do this for you though if you don't understand any of this ]

-mk



[Edited by atlas on 03-08-2001 at 01:26 PM]

harrylmh
March 8th, 2001, 17:21
Hi atlas,
I'm a greenhorn when it comes to unix stuff.
I also learned how to go from one directory to another. The script that I was trying to install provided instructions on making a cron file then, crontab file to add the entries.

atlas, I got lots of people helping me out but everybody can't seem to know what's the problem - why the crontab can't work.

PS: Is it ok, to add comment lines inside a cron file? like:
###comment###

Thanks.

atlas
March 8th, 2001, 18:37
Comments are allowed and start with '#'

I like to just place the following line on the top of my crontab files to remind myself.



# MIN HOUR DAY MONTH DAYOFWEEK SCRIPT


Ok, make sure you have it set to be executable, also if you're using a Solaris box you can't have any blank lines, a trailing newline character, or use the /5 or any "short" notation.

-mk

harrylmh
March 9th, 2001, 03:18
Oh but what do you mean by have it set to be executable?
What's a trailing newline character? '\n'?
Also, does */10 and 0,10 mean the same thing - every 10 minutes?

Thank you.

atlas
March 9th, 2001, 06:19
Originally posted by harrylmh
Oh but what do you mean by have it set to be executable?
What's a trailing newline character? '\n'?
Also, does */10 and 0,10 mean the same thing - every 10 minutes?

Thank you.

Trailing newline basically there exists a line at the end that has nothing on it.

*/10 means every ten minutes and is equivalent to 0,10,20,30,40,50

Set to executable -- I'm talking about the script/program you want to run, not cron. chmod it with at least a 5 for that user

-mk

harrylmh
March 9th, 2001, 09:33
Hello!
you know atlas, I even got my host server's tech support to help me with the crontab but still no progress. Yes, the program to execute was set to 755. But it still doesn't work.

I tried this:
*/1 * * * * home/path/script.cgi > textfile.txt

to see if the program would work if it was a different program. If it works, it should create the text file when it runs the program. But, nope.

What do you think, atlas? Do you think it's the crontab?

Thanks for helping me out, btw.

atlas
March 9th, 2001, 12:00
Make sure to use an absolute link:

You have something like this? :



*/1 * * * * home/path/script.cgi > textfile.txt


Make it absolute (start from the root)



*/1 * * * * /full/path/to/home/path/script.cgi > textfile.txt


Is this a linux server?

-mk

harrylmh
March 10th, 2001, 10:13
Hey atlas!
I guess I kinda missed the email notification but anywayz,
I think its Unix. Should be. Cos it doesn't have ASP(?). I'm with hostrocket.com . They didn't specify the type of server anyway except in the dedicated servers page where they mentioned apache webserver.

And for the file creation thing, it worked but the file was created in the root folder so I missed it. So this proved that the crontab is working. It must be the script!

I don't think there's nothing much anyone can help me already. I mean the author told me to talk to the server admin and the server admin takes 1 day to reply once...so..

Well, for all its worth, thank you again for your help, atlas! I really appreciate it. See you around. :p