Editing crontab via ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Editing crontab via ksh
# 1  
Old 10-27-2011
Editing crontab via ksh

Hi all,

I am trying the following
Quote:
oracle@blah:blah > {
> crontab -e
> echo "#this is a test"
> echo "\033:wq!"
> } | crontab -l
I am hoping that the crontab would be changed.
but it prints the previous crontab and says
Quote:
"The crontab file was not changed."
Can anyone tell me the correct ksh command that should be used here?
I don't want to edit the crontab with crontab -e, I need to edit it via ksh.

Thank you,
Sara
# 2  
Old 10-27-2011
Code:
crontab -l > cron
echo "#this is a test" >> cron
crontab cron

This User Gave Thanks to rdcwayx For This Post:
# 3  
Old 10-27-2011
Super! Thanks Smilie

Last edited by ajaba; 10-27-2011 at 07:22 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Crontab editing issue

Hi, OS - SunOS I gave crontab -e then it returns zero. $ crontab -e 0 ? ? Crontab status - $ ps -ef | grep cron root 2481 1 0 May 12 ? 0:18 /usr/sbin/cron Please help (9 Replies)
Discussion started by: nag_sathi
9 Replies

2. UNIX for Dummies Questions & Answers

Editing crontab of non-root user from file

Hi All, Ref: "build crontab from a text file" in same forum. (I am not allowed to post URL's in the first post) We are reorganizing our UNIX Crontab file by first making changes in a word pad text file. The intent is to then copy it back to Crontab. Will this work? Copy and Paste does not... (6 Replies)
Discussion started by: nivedhitha
6 Replies

3. Shell Programming and Scripting

csv file editing using KSH

I'm trying to write a shell script to extract useful fields in a csv file and copy them to a new file: the input file is as below when opened using notepad++: //////////////////////////////////////////////////////////// ZZZZZZZZZZZZZZZZZZZZZZ ,"A", , , ,24,18,0,0,42,0 , ,B, ,... (1 Reply)
Discussion started by: zekruss
1 Replies

4. Fedora

editing crontab help

I'm using fedora 5 and sql 5.0. I'm trying to edit the crontab to perform automatic backups of my database. For some reason it isn't working. Here is what I have so far. 15 2 * * * /usr/bin/mysqldump -opt -all-databases u root -ppassword -h localhost... (10 Replies)
Discussion started by: randerson21
10 Replies

5. UNIX for Dummies Questions & Answers

Editing a cron file with crontab

I want to set up a file with crontab to run the cron deamon so I can use at to schedule jobs. I think the crontab file (or whatever you call it) has to be set up. Currently, I don't have a crontab file (I checked by typing sudo crontab -u myusername -l), and I don't know the syntax for creating... (6 Replies)
Discussion started by: Ultrix
6 Replies

6. Solaris

editing crontab with vim and using .vimrc

Hi since we migrated from Solaris 8 to Solaris 10 I do miss a nice feature when editing crontab with vim editor: no more color highlighting after starting to edit. Well there is a hack, see below. I did define: export EDITOR='vim -c ":source /export/home/duc904/.vimrc"' Under Sol8 when... (2 Replies)
Discussion started by: duc904
2 Replies

7. UNIX for Dummies Questions & Answers

ksh command line editing text being overwritten

hi. i'm using ksh with set -o vi. if i am far down in a directory and try to edit the command line (esc-k to retrieve previous command) the cursor is being positioned over to the left on top of the directory text making the text very difficult to read or work with. seems to be problem with long... (2 Replies)
Discussion started by: jeffa123
2 Replies

8. Shell Programming and Scripting

Editing a ksh script > Please assist!

I am trying to edit a script that contains the following: /DBA/general/sh/rman_backup.ksh -d PROD2 -l 1 I am trying to add a logic in the script such that if /DBA/general/sh/rman_backup.ksh does not exists, then the script would return an error code of 1. Otherwise, the script continues... (4 Replies)
Discussion started by: ora_umair
4 Replies

9. Shell Programming and Scripting

Editing Crontab

Hi I am not able to edit crontab. Following is the comand that is being issued $crontab -e 2764 ............ This is what I am able to see But when I do $crontab -l List of all the crontab entry is displayed. Also I am seeing one entry in my /etc/cron.d prw------- 1 root ... (6 Replies)
Discussion started by: pankajkrmishra
6 Replies

10. Shell Programming and Scripting

Editing file during running ksh in HP failed

Hi falks, I have the following program: #!/bin/ksh ed -s /home/ias/v9.0.3/j2ee/OC4J_RiGHTv_HPCD2/applications/Xbip/Xbip/WEB -INF/config/application.properties <<EOF >/dev/null 1 d . d . a application.filePath.core = /core-HPCD2/Html/ application.filePath.xbip =... (2 Replies)
Discussion started by: nir_s
2 Replies
Login or Register to Ask a Question