We help IT Professionals succeed at work.

Crontab Setup step by step

TheGD
TheGD asked
on
1,518 Views
Last Modified: 2010-08-05
Hello Experts,
I have SSH connection established with my domain hosting through PuTTY. I typed crontab -e and now come to an editor I am very much unfamilier with. I am trying to setup following cronjob

00 16 * * * /home/u4/highbridge/html/cron.php

After I typed crontab -e I tried to enter the above line, but it is not entering it, nothing is displayed. I would really appreciate if any one can guide me with the step by step process in order to accomplish my task.

Thanks.
Comment
Watch Question

Data Warehouse / Database Architect
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Kdo

Thank you very much for helping me out. Yes the default editor is vi. I tried to switch to nano by export EDITOR=nano but it was not working with crontab -e comand.
Kent OlsenData Warehouse / Database Architect
CERTIFIED EXPERT

Commented:
Hi TheGD,

Try this:

export VISUAL='nano'

Then the crontab-e should use nano.

And you thought that the variable that contained the editor name would be 'EDITOR', huh?  Silly operating system, isn't it?


Good Luck,
Kent
CERTIFIED EXPERT
Top Expert 2007

Commented:
Most of the time, users are not comfortable with crontab -e to add or modify crontab jobs schedules

So a better way is

crontab -l > mycronjobs

edit mycronjobs with your favorite editor (e.g. vi)

crontab mycronjobs

crontab -l

Author

Commented:
Hello Kdo
You really are a very generous person with a good sense of humour :) Thanks for the advice again I really want to setup my hands on Unix. Following is the output of the commands you suggested. I also included the output of the program which I tried earlier, and it is very much the same.

Copyright 1996-2006 Aplus.Net Internet Services
FreeBSD 6.2-STABLE (PRO6) #0: Wed Sep 19 09:12:47 PDT 2007
*************************************************************************
**  By logging into this server you agree to abide by the A+Net Web    **
**  Hosting terms of service. If you do not agree with these policies, **
**  do not log in. All activities on this server are logged.           **
*************************************************************************
[highbridge@pro ~]$ export VISUAL='nano'
[highbridge@pro ~]$ crontab -e
crontab: nano: No such file or directory
crontab: "nano" exited with status 1
[highbridge@pro ~]$ export EDITOR=nano
[highbridge@pro ~]$ crontab -e
crontab: nano: No such file or directory
crontab: "nano" exited with status 1
[highbridge@pro ~]$

Author

Commented:
Hello Omar Farid
I have noted your suggestion. Thanks.
CERTIFIED EXPERT
Top Expert 2007

Commented:
You could have

export EDITOR=vi

Author

Commented:
Omar vi is my default editor and thanks to Kdo that I have come to know how to use it.
Kent OlsenData Warehouse / Database Architect
CERTIFIED EXPERT

Commented:
Hi TheGD,

It's probably some variation and "trial and error" is the best way to figure it out.  If nano is accessible via your current path, then:

  export VISUAL=nano

If not, you'll have to include the path name, like:

  export VISUAL = /bin/nano


Try

  whatis nano   (or)
  whence nano  (or)
  find / -name nano


Good Luck,
Kent
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.