The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Crontab question blondie2407 HP-UX 12 09-16-2009 01:53 PM
Crontab Question. NycUnxer UNIX for Dummies Questions & Answers 9 11-14-2007 11:53 AM
CRONTAB Question pauls_579 UNIX for Dummies Questions & Answers 2 01-23-2007 05:46 PM
crontab question steelrose UNIX for Dummies Questions & Answers 5 10-05-2005 12:07 AM
crontab question Relykk UNIX for Dummies Questions & Answers 7 03-28-2004 08:02 PM

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

Join Date: Mar 2004
Posts: 39
Question Crontab question

Hello,
Does anybody know of a way to add an entry to the crontab without executing >crontab -e? I'm running a script that would add a line without any user intervention. The only way I could think of would to use sed to add the line to the end of the cron file, but I don't know if this would cause problems. Would it?
OS - aix 5.3

thanks,
  #2 (permalink)  
Old 10-19-2006
ctcuser ctcuser is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 39
OK, will the following sequence of commands work or will it cause problems? I found this after I posted my question.
crontab -l > mycrontab
#add a line via sed command to mycrontab
crontab < mycrontab

thanks,
  #3 (permalink)  
Old 10-19-2006
Glenn Arndt's Avatar
Glenn Arndt Glenn Arndt is offline Forum Advisor  
Anomalous Lurker
  
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
Yes, something similar to that should be fine.
Code:
crontab -l > crontab.tmp
# [manipulate contab.tmp]
crontab crontab.tmp
rm crontab.tmp # if you want to delete the .tmp file
  #4 (permalink)  
Old 10-19-2006
ctcuser ctcuser is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 39
thank you.
Sponsored Links
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 03:13 AM.


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