Cron issue


 
Thread Tools Search this Thread
Operating Systems Solaris Cron issue
# 1  
Old 05-09-2008
Cron issue

When I list whats in cron -l its fine but when I try to -e edit it...it returns a number 309 can't you not edit cron this way with solaris 10? I can do it fine in sol 8 and 9.

export EDITOR="vi" is set in my profile

I am using BASH

Code:
$ sudo crontab -l
Password:
#ident  "@(#)root       1.21    04/03/23 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
#
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
#10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___

$ sudo crontab -e
309


Last edited by kingdbag; 05-12-2008 at 05:10 PM..
# 2  
Old 05-11-2008
you never mentioned what shell you are using?

The command you typed only works for ksh

do an echo $SHELL and see what it says.

if you are using bourne shell then the command is in complete

the complete command to export EDITOR or export anything under bourne shell is ..

EDITOR=vi;export EDITOR
# 3  
Old 05-11-2008
Using sudo clear the EDITOR variable anyway.

309 is the number of characters in the crontab file as you are using the venerable default editor, ed.

Time to learn using ed or use a supported way to run privileged commands, as sudo is not part of Solaris 10.
# 4  
Old 05-12-2008
help on cron needed.

Hi folks, I am new into working on UNIX. I wanted to run a .sh script daily(say at 10 AM). I came to know about setting a cron job for this. I did go through the tutorial on how to add a cron job. This is what i did:

vi update.cron

MAILTO="myid@yahoo.com"
0 10 * * * somescript.sh >>/dev/null 2>&1

then saved the file.
then i did,

crontab update.cron.

question is :
1. will this work from any directory, which i'll be working in or i need to go to a specific directory?

2.when i execute crontab -l it does lists the added job but at the stipulated time the script/cron job does not run.Is there any other format or updation in any file that i should be doing.

Thanks a lot in advance
# 5  
Old 05-21-2008
don't find you way throug funny means. Just follow procedure bro!. cd /var/spool/cron/crontabs
ls
more OR vi root (to edit root cronjobs)
to allow/disallow norm user from executing/creating cron,
cd /etc/cron.d/
vi cron.deny (to include a/cs that is to be denied etc)
# 6  
Old 07-10-2008
I fixed this by adding lines below to my .profile. Thing that fixed it was TERM but EDITOR should be set also.

Code:
export TERM=vt100
export EDITOR=vi

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron issue

i have written a script to sftp yesterday's logs from another server as below: cd /export/home/abc/xyz/tt d=`gdate -d'yesterday' +%Y%m%d` sftp abc@XXX.XX.XX.XX<<EOF cd /yyy/logs/archive mget abc.log.$d* EOF cd /export/home/abc/xyz/scripts nohup ./ss.sh PROD & it is working fine... (2 Replies)
Discussion started by: ssk250
2 Replies

2. Solaris

CRON Issue

Hello, I am running Solaris 8. I have set a cron job that runs every couple hours. If I run the script manually, it runs just fine (logged in as root). The cron however will not run. It is producing an rc=1 error. Any thoughts would be appreciated. Thanks (4 Replies)
Discussion started by: jkmtm
4 Replies

3. Ubuntu

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (3 Replies)
Discussion started by: manjunath.nm89
3 Replies

4. UNIX for Dummies Questions & Answers

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

5. UNIX for Advanced & Expert Users

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

6. Shell Programming and Scripting

Issue with Cron

Hi Gurus, I need to run a script every saturday at 7:05 PM. Below command is working in x86_64. 05 19 * * 6 /apps/informatica/scripts/inf_rest.ksh However when I tried in HP-UX it is giving the below error. crontab: error on previous line; unexpected character found in line. Please... (4 Replies)
Discussion started by: svajhala
4 Replies

7. Red Hat

Cron Issue

Hey all! I'm working on setting up a script to run with cron. I have thus far been unable to get it to successfully complete. I'm hoping you gurus can lend me a hand. This is my crontab, the transfer script works fine the backup will not. The backup however does work when I execute it from the... (11 Replies)
Discussion started by: spiffyville
11 Replies

8. Shell Programming and Scripting

A Cron Issue

Hi Guys.,, This thing is driving me crazy.. I have this script which runs perfectly fine. If it is not able to connect to database it will drop a mail which it does when i ran it manually. But when i am running it from crontab, the script is not sending mail to me but to my id(login id)... (0 Replies)
Discussion started by: mac4rfree
0 Replies

9. Red Hat

cron issue

Hello, Having and issue with a job scheduled in cron. The script: #!/bin/bash 2 3 # Example shell script which can be added to roots cron job to check the 4 # Embedded Satellite disk space usage. If any table is over 90% usage, send 5 # a notice to the default email address... (2 Replies)
Discussion started by: mgb
2 Replies

10. UNIX for Advanced & Expert Users

cron issue

user x has a cron job that looks in a dir and moves teh files from 1 name to another except its not working correctly. . /user/.profile # sorce the users profile for file in `ls`; do mv $file $file.`date +%Y%m%d%H%M%S``microsec` done microsec is a binary with 555 perm. on it in... (5 Replies)
Discussion started by: Optimus_P
5 Replies
Login or Register to Ask a Question