Edit Crontab | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Edit Crontab

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-27-2006
juliet juliet is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 29 September 2006, 9:24 AM EDT
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Edit Crontab

Hi

I am new to Unix and would like some assistance.

I need to edit the crontab file so that a script is set to run at 3:00 am each day.

When I telnet to the sun server and type crontab -e a black screen appears and I am unable to make any changes.

Could you advice on what is needed to edit the crontab file and what should the script say to achieve my goal.

Regards
Sponsored Links
    #2  
Old 09-28-2006
Andrek Andrek is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 27 April 2010, 9:08 PM EDT
Posts: 122
Thanks: 0
Thanked 0 Times in 0 Posts
Looks like you do not have a crontab file set up or its corrupted.
try crontab -l to list the crontab file...
Still nothing...

use the crontab -e to start your new crontab file
enter the commands then save it.

3:00am each day would be
00 3 * * * /my/script/to/run > /dev/null 2>&1
do a man on crontab or cron for info
Sponsored Links
    #3  
Old 09-28-2006
juliet juliet is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 29 September 2006, 9:24 AM EDT
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Crontab Edit

Hi

Thanks for your response. I was able to locate the crontab file. Could you identify the actual steps to edit the file. There is a command string currently in place. How can I delete and replace. Can I use notepad or some other editing software to access the crontab file.

Thanks
    #4  
Old 09-28-2006
Glenn Arndt's Avatar
Glenn Arndt Glenn Arndt is offline Forum Advisor  
Anomalous Lurker
 
Join Date: Feb 2006
Last Activity: 2 February 2012, 9:30 AM EST
Location: Indianapolis, IN
Posts: 255
Thanks: 0
Thanked 2 Times in 2 Posts
See this thread: cron and crontab

Provides a good overview of how cron works.
Sponsored Links
    #5  
Old 09-28-2006
safraser safraser is offline
Registered User
 
Join Date: Aug 2005
Last Activity: 31 October 2013, 10:14 AM EDT
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Juliet,

I'm not a unix guru, either, and I was mystifed by the crontab business at first.

I don't know what your OS is... Mine is Solaris. When I first launched crontab -l or -e, my screen was not blank but it did just hang there without doing anything. This was because I had not specified any type of editor for my environment variables. Don't know if this might be your problem?

First, I execute:
export EDITOR=vi

Then, I execute:
crontab -e

This brings up a vi editor into which the cron jobs are set up. If you are really really new to unix, you might not be familiar with vi, which is a unix text editor. Find a cheat sheet for vi, before you use it the first time.

Like everyone has said, do NOT edit the crontab file directly. Only do it with the crontab -e command.

Hope this helps,
Shirley
Sponsored Links
    #6  
Old 09-28-2006
juliet juliet is offline
Registered User
 
Join Date: Sep 2006
Last Activity: 29 September 2006, 9:24 AM EDT
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Crontab Edit

Hi

Thanks for your response, I now believe I am gettin a little closer to resolving the issue.
I typed export EDITOR=vi, and got this error message "EDITOR=vi: is not an identifier". Also could you identify where I can find a cheat sheet for vi.

What should I do here.
Sponsored Links
    #7  
Old 09-28-2006
safraser safraser is offline
Registered User
 
Join Date: Aug 2005
Last Activity: 31 October 2013, 10:14 AM EDT
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Search this site for "vi tutorial" and you will find a link to a README that includes tutorials for lots of unix stuff, including a couple specifically for vi.

As I mentioned, I am on Solaris. Perhaps you are on a different OS which would require a different syntax for setting the editor.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Error when trying to edit crontab bbbngowc UNIX for Dummies Questions & Answers 0 01-25-2010 12:05 PM
How to edit the crontab file rajus19 Shell Programming and Scripting 2 05-25-2007 08:34 AM
Different edit crontab at Solaris..? srilinux Solaris 25 12-17-2006 01:50 AM
edit crontab without -e d_swapneel14 Shell Programming and Scripting 8 04-11-2006 03:50 AM
Can't edit crontab FredSmith UNIX for Dummies Questions & Answers 1 10-24-2005 05:12 PM



All times are GMT -4. The time now is 08:38 PM.