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 > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
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 ctcuser Shell Programming and Scripting 3 10-19-2006 09:22 AM
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

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-12-2006
blondie2407 blondie2407 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 2
Crontab question

Please cna you tell me if the following command entered in error would affect the crontab file

crontab -e | more

Thanks
  #2 (permalink)  
Old 09-12-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
crontab -e is used to edit (modify) the crontab file. Piping it to more is no use. You may want to look at crontab -l. The crontab command also does error checking on the edited/modified file and will not update the actual crontab file unless the new file is error free.
  #3 (permalink)  
Old 09-13-2006
blondie2407 blondie2407 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 2
Thanks blowtorch. But it was in error that I used the -e option and was worried the the command I used would affect the crontab file. The command I wanted to use was crontab -l | more . With crontab using the vi editor and then more for the display I was worried it would affect the file
  #4 (permalink)  
Old 07-03-2009
Sumedha Sobti Sumedha Sobti is offline
Registered User
  
 

Join Date: Jul 2009
Location: India
Posts: 9
Hi

1. crontab -e
This command is used ONLY for editing/adding the crontabs in vi editor.
2. crontab -l
This command just dispalys all crontabs at once, the file is not affected
3. crontab -l | more
This command display the crontabs, incase you file happen to be large,
hit the spacebar to view more.
The file again is not affected.

P.S: Make sure you have spare copy of your crontab file somewhere

Regards
Sumedha

Last edited by Sumedha Sobti; 4 Weeks Ago at 07:45 AM..
  #5 (permalink)  
Old 07-03-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,546
Old admin point of vue:
using crontab -e : fine you modify etc... but many people do that without having a spare (copy somewhere), some admins when have to do strong maintenance e.g after a crash and under pression dont want things else disturbing then and simply delete the content of the cron spool.. else, if things dont work one day, how do you compare ? (noe previous copy...).
So if you are not too confident, a good way to do things is to have your cronfile somewhere where all cron users can read (so they have no excuse in overlapping schedules...) I usually put them in /sm/cron/ , suffixed by your account name e.g confile.blondie, if paranoid make a second copy ( I do...) cronfile.blondie.last, before any modification you can compare (no one else modified without you knowing of you modified without updating...) lets say you put the cronfiles in /sm/cron
Code:
cd /sm/cron
crontab -l >cronfile.blondie
diff blondie blondie.last
use vi to edit/modify
then load the new file:
Code:
vi cronfile.blondie
crontab cronfile.blondie
you can chack your update with crontab -l | more ...
I add in comment where the file should be and its name:
Code:
# =========================================================================
# /sm/cron/cronfile.prod   prod's cronfile (crontab)
# =========================================================================
#      F O R M A T
# =========================================================================
#  Minute    Hour    Month_Day    Month    Weekday    Command
#  (0-59)   (0-23)   (1-31)       (1-12)   (0-6)*0=sun run-string 
# =========================================================================
#
All the best
  #6 (permalink)  
Old 07-03-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,640
Also, it seems like you are using vi on your crontab. Don't. Use crontab -l or crontab -e
  #7 (permalink)  
Old 07-03-2009
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,518
Quote:
Originally Posted by jim mcnamara View Post
Also, it seems like you are using vi on your crontab. Don't. Use crontab -l or crontab -e
I always VI my crontabs
Sponsored Links
Reply

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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