How to change crontab entries?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to change crontab entries?
# 1  
Old 07-22-2013
How to change crontab entries?

How to edit crontab entries .
A job is scheduled as
Code:
35 15 * * *  it.sh rahul_raj/hdhd

i want to change it as
Code:
45 15 * * *  it.sh rahul_raj/hdhd

1.crontab -e

2.shift+g ---go to last line .press enter.Press <i> .
After this what should i do?
# 2  
Old 07-22-2013
What do you think might be the next step?
# 3  
Old 07-22-2013
After crontab -e, its similar to vi. Just edit and Esc + :wq!
# 4  
Old 07-22-2013
Quote:
Originally Posted by rajamadhavan
After crontab -e, its similar to vi. Just edit and Esc + :wq!


Hi,
I have one issue

i have scdelued the job as
Code:
23 04 * * *  it.sh /arbor/integ_fx/rahul_raj/itsr_5652

the time in unix system is
Code:
Mon Jul 22 04:20:30 PDT 2013

But the script it.sh is not executing i guess as i see no log files in the folder.
here is the below code for it.sh
Code:
#!/bin/sh
ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH
today=`date "+%m-%d-%Y  %H:%M:%S"`; export today
CUR_DIR=$1; export CUR_DIR


LOG_FILE=error.log; export LOG_FILE

# Direct script output to log
exec > $LOG_FILE 2>&1

echo
echo
echo "LOGGING STARTS $today"
echo
echo
###Fetching the script directory from configuration file 
SCRIPT_DIR=`cat .id_pass_file.txt | grep "^SCRIPT_DIR" | cut -d "=" -f2`; export SCRIPT_DIR

### Credentials for SQLPLUS

USER_ID=`cat .id_pass_file.txt | grep "^USER_ID" | cut -d "=" -f2`; export USER_ID
PWD=`cat .id_pass_file.txt | grep "^PWD" | cut -d "=" -f2`; export PWD
SID=`cat .id_pass_file.txt | grep "^SID" | cut -d "=" -f2`; export SID


### Connecting ORACLE

echo "SQLPLUS CONNECTION"

sqlplus -s $USER_ID@$SID/$PWD<<EOF>$CUR_DIR/sql_output.txt
set feedback off
set heading off
select distinct account_no from adj  WHERE ADJ_TRANS_CODE=-2401  and request_status=1  and bill_ref_no=0
order by account_no;
EOF


if [ $? -eq 0 ] 
then 
echo " SQLPLUS Connection Successful "
else
echo " SQLPLUS Connection Failed "
fi

##echo " The account numbers to be used in BIP are  "



if [  ! -s  "$CUR_DIR/sql_output.txt" ]
then
echo "No account number for bad debt" 
else
for i in `cat $CUR_DIR/sql_output.txt`
do
echo "bip $i is running"
cd $SCRIPT_DIR
sh bip.sh 01 0 $i >  $CUR_DIR/bip_log_1.txt
sleep 100
done
fi


###Removing temporary log files generated 

if [  -f  $CUR_DIR/bip_log_1.txt ]
then
`rm  $CUR_DIR/bip_log_1.txt`
 echo "file bip__log_1.txt removed"
fi

if [  -f  $CUR_DIR/sql_output.txt ]
then
`rm  $CUR_DIR/sql_output.txt`
 echo "sql_output.txt removed"
fi

# 5  
Old 07-22-2013
You will need to check if the cron task triggered at the specified time. Check if the cron daemon is running
Code:
ps -ef | grep cron

# 6  
Old 07-22-2013
Look also for syslog entries around the time specified.
# 7  
Old 07-23-2013
Questions about cronjobs often arise; because of this there is a Q&A article here in the forum that explains it all in detail:
cron and crontab
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

How to list all crontab entries?

Hi, 1. How can I list all the crontab entries of all system users (like root, adm, sys etc.) as we have multiple files like /etc/crontab , /var/spool/cron, /etc/cron.d, /etc/cron.daily, /etc/cron.hourly, /etc/cron.monthly etc. 2. How can I list all the crontab entries of ALL users on a... (1 Reply)
Discussion started by: prvnrk
1 Replies

2. UNIX for Dummies Questions & Answers

How to change crontab output from console to email?

Hi, We are currently running AIX 6.1 TL4. There are around 30 ksh scripts that are ran from crontab which if an error occurs or a problem with an ftp unix sends the out of the ksh script which goest to our console via the local user hci which is viewed by the mail command. I've tired adding... (2 Replies)
Discussion started by: hgjdv
2 Replies

3. Shell Programming and Scripting

Make entries in crontab file

I have created a shell script "abcd.sh" and script should run after every 10 min., For that I will create below entry in the crontab file by using command crontab -e */10 * * * * /cdr/work/proc_raw/abcd.sh >> /dev/null 2>&1 I wish to know whether above entry is correct or I have to make entry... (2 Replies)
Discussion started by: Devesh5683
2 Replies

4. Shell Programming and Scripting

Wants to change shell script into crontab

Hi friends, Actually i wrote many scripts in korn shell for time saving activity in storage domain. But every week i am spending some time for the running of script. So every Monday i wants to run my scripts automatically. So corn will be helpful according to my friend's opinion. But I don't... (5 Replies)
Discussion started by: Mahendranath
5 Replies

5. Shell Programming and Scripting

Change crontab from shell script

Hi All, I have scheduled a script to run every five minutes through crontab. If there is any issue with the script which may need manual intervention, I have used the mailx commands. But at the same time, I would want the cron to be disabled until the issue is resolved. Once things are fine,... (2 Replies)
Discussion started by: adi_2_chaos
2 Replies

6. Solaris

Duplicate crontab entries

hi guys. can someone tell me what will happen if there are two identical crontab entry for an application. For example 03 23 * * 1 /usr/vt/crondemo 03 23 * * 1 /usr/vt/crondemo will the file crondemo run twice, once or wont run at all?? (2 Replies)
Discussion started by: vikashtulsiyan
2 Replies

7. Shell Programming and Scripting

how to change crontab entries

Hi Friends, I need to change crontab entries in prod. $crontab -l -> using this i can see the entries only Plese tell me how to edit this crontab and how to change the entires Waiting for ...... Thanks In advance friends Krish. (2 Replies)
Discussion started by: kittusri9
2 Replies

8. Shell Programming and Scripting

Crontab change and email notification

Hey guys Just need some help with crontab.Iam looking for a script that will alert particular user about its change through sendmail.We are using bash here. --CoolKid (3 Replies)
Discussion started by: coolkid
3 Replies

9. UNIX for Dummies Questions & Answers

Using Crontab To Change User Password

Hi! I'm a bit noob on Unix/Linux world, so sorry any lame question i may make... Oh.. and my english too.. is not so famous lol.. The deal is to use crontab to change my admin password every weak to something like "mypasswordcurrrentday" that is... i want evey weak to change my password but... (2 Replies)
Discussion started by: OdinPT
2 Replies

10. UNIX for Advanced & Expert Users

crontab entries deleted !!

Hi all, A friend of mine accidently erased all crontab entries by typing crontab -r. Can anyone pls. help me on this. Is it possible that a backup file is available other than files from the backup tape. Or is it retrievable ??? Thnx, MK (6 Replies)
Discussion started by: minazk
6 Replies
Login or Register to Ask a Question