The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to edit the crontab file rajus19 Shell Programming and Scripting 2 05-25-2007 09:34 AM
Different edit crontab at Solaris..? srilinux SUN Solaris 25 12-17-2006 02:50 AM
Edit Crontab juliet UNIX for Dummies Questions & Answers 11 09-28-2006 05:32 PM
Can't edit crontab FredSmith UNIX for Dummies Questions & Answers 1 10-24-2005 06:12 PM
Crontab - Recommended way to edit? frustrated1 UNIX for Advanced & Expert Users 3 08-26-2003 04:45 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-07-2006
d_swapneel14 d_swapneel14 is offline
Registered User
  
 

Join Date: Mar 2006
Location: Mumbai,India
Posts: 57
edit crontab without -e

hi

i need to change crontab settings as
minute,hour,day of month,month year,day of week
certain times. for that i need to go as crontab -e. i want to avoid that as its creating many problems in mysystem.

so here i m planning/trying to write a script that will update the settings in crontab as per arguments from user.
can we do this?
plz any guidelines...

Thanks

Best Regards,
Swapneel
  #2 (permalink)  
Old 04-07-2006
matrixmadhan matrixmadhan is online now Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
prior trying this take a backup of your crontab file
modify the changes to the crontab file backup
and then redirect the modified file as


Code:
crontab < filename

  #3 (permalink)  
Old 04-08-2006
abhijeetkul abhijeetkul is offline
Registered User
  
 

Join Date: Oct 2005
Location: Mumbai,India
Posts: 58
Thumbs up

what problems ?
have u set the EDITOR?

its always better to modify cronjobs via crontab -e..
anyways

regards
abhijeet
  #4 (permalink)  
Old 04-10-2006
d_swapneel14 d_swapneel14 is offline
Registered User
  
 

Join Date: Mar 2006
Location: Mumbai,India
Posts: 57
hi abhijeet,matrixmadhan

see i have some shellcomads in crontab.
i my trying to write a script which will ask abt the
new time and new date ....


see here line numbers are same. measn if i say i want to edit 6th line of crontab i.i. monthlyprocess

so my script will chnage only that line.

thanks for your help

regards,
swapneel
  #5 (permalink)  
Old 04-10-2006
matrixmadhan matrixmadhan is online now Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
thats what i have said!!!

whatever be the change you are going to make,
do it on the crontab entry file redirected through crontab -l

and once you are done with the changes redirect the file with changes to effect the crontab once again as mentioned in the previous post.
  #6 (permalink)  
Old 04-10-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Just one thing. You have to restart cron for changes to take effect if you do not use the crontab command to edit the file. Check this thread where Perderabo has corrected me regarding this.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0