how to save crontab | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

how to save crontab

Shell Programming and Scripting


Tags
linux

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-07-2005
shahab03 shahab03 is offline
Registered User
 
Join Date: Mar 2005
Last Activity: 2 September 2005, 3:17 PM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Network how to save crontab

how does one save changes in crontab? i am using vi editor. Issued crontab -e command on the prompt. however not sure how to save changes. :wq doesnt work. any idea....
Sponsored Links
    #2  
Old 03-07-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Registered User
 
Join Date: Apr 2002
Last Activity: 3 April 2014, 2:50 PM EDT
Location: On my motorcycle
Posts: 3,092
Thanks: 1
Thanked 29 Times in 9 Posts
If your EDITOR isn't set, then just type q to get back to the prompt. If EDITOR is vi, then hitting the escape key, :, wq should work.
Sponsored Links
    #3  
Old 03-07-2005
shahab03 shahab03 is offline
Registered User
 
Join Date: Mar 2005
Last Activity: 2 September 2005, 3:17 PM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
still doesnt work

I tried following
$ crontab -l
#00 20 * * * /u02/app/oracle/admin/PROD/scripts/db_bkup.ksh
#5,20,35,50 6-19 * * * /u02/app/oracle/admin/PROD/scripts/db_move_out_logs.ksh
#00 20 * * * /u02/app/oracle/admin/PROD2/scripts/db_bkup.ksh
#5,20,35,50 6-19 * * * /u02/app/oracle/admin/PROD2/scripts/db_move_out_logs.ksh

$ crontab -e
284
1 * * * * /u12/archive/rm_archive.sh
?
q
The crontab file was not changed.
$

EDITOR=vi doesnt help either. is it possible to locate the crontab file and write directly to it? thanks a lot
    #4  
Old 03-07-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Registered User
 
Join Date: Apr 2002
Last Activity: 3 April 2014, 2:50 PM EDT
Location: On my motorcycle
Posts: 3,092
Thanks: 1
Thanked 29 Times in 9 Posts
You need to set your EDITOR variable.

If you are using sh or ksh
$ EDITOR=vi
$ export EDITOR
$ crontab -e

If you are using csh
% setenv EDITOR vi
% crontab -e

If you are using some other type of shell, please post which one (although one of those two suggestions should work for other shells).
Sponsored Links
    #5  
Old 03-07-2005
shahab03 shahab03 is offline
Registered User
 
Join Date: Mar 2005
Last Activity: 2 September 2005, 3:17 PM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
able to make changes

hi..thanks a lot. i was able to make changes. however its not running. how do I find out if cron even executed?

my entry looks like this.

1 * * * * /u12/archive/rm_arch.sh

now this should execute every minute.. but its not doing anything. thanks a lot.
Sponsored Links
    #6  
Old 03-07-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 18 April 2014, 4:11 PM EDT
Location: Ashburn, Virginia
Posts: 9,833
Thanks: 42
Thanked 378 Times in 225 Posts
Quote:
Originally Posted by shahab03
hi..thanks a lot. i was able to make changes. however its not running. how do I find out if cron even executed?

my entry looks like this.

1 * * * * /u12/archive/rm_arch.sh

now this should execute every minute.. but its not doing anything. thanks a lot.
That should run once an hour. Change the 1 to an asterisk for every minute.
Sponsored Links
    #7  
Old 03-07-2005
shahab03 shahab03 is offline
Registered User
 
Join Date: Mar 2005
Last Activity: 2 September 2005, 3:17 PM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
perfect

it runs.. how can change my entry to run every half hour?

new entry:


* * * * * /u12/archive/rm_arch.sh


its interesting SUN's website shows first entry is for minutes. why it didnt work when I put 1 in the first place?

old entry
1 * * * * /u12/archive/rm_arch.sh

thanks
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
How to save crontab configuration when using SSH? Roger75 Linux 1 04-28-2010 11:11 AM
Save cURL verbose output to file or do it like browser "save as.." crabmeat Shell Programming and Scripting 0 01-23-2010 04:49 PM
can't save crontab with vi idan_cn UNIX for Dummies Questions & Answers 3 07-04-2008 04:44 AM
Crontab refuses to save changes! fire>ant> UNIX for Dummies Questions & Answers 18 04-25-2005 03:56 PM
save me! hufs375 Shell Programming and Scripting 2 05-27-2002 09:03 AM



All times are GMT -4. The time now is 05:11 PM.