Cron entry not running


 
Thread Tools Search this Thread
Operating Systems Solaris Cron entry not running
# 8  
Old 04-28-2014
Start by telling the differences between both of these scripts.
Code:
cd /moneta_polled01/download
ls -l get_dealer.sh mov_dealer.sh
diff get_dealer.sh mov_dealer.sh

You should also explain how you assert the first one doesn't run well. Any error message ? Did you check for mails ?
# 9  
Old 04-28-2014
this is:
Code:
 ls -l get_dealer.sh mov_dealer.sh
-rwxrwxrwx   1 root     root         153 Apr 28 09:42 get_dealer.sh
-rwxrwxrwx   1 root     root         736 Apr 25 08:27 mov_dealer.sh


I know its not working because if I do a
Code:
ls -lrt

after the time set in cron, I do not have the file, but if run it manually
Code:
# pwd
/moneta_polled01/download
root@moneta # ls -lrt
total 4
-rwxrwxrwx   1 root     root         736 Apr 25 08:27 mov_dealer.sh
-rwxrwxrwx   1 root     root         153 Apr 28 09:42 get_dealer.sh
root@moneta # ./get_dealer.sh

I get the file.
# 10  
Old 04-28-2014
It may be working. Just change the the directory to someplace you know and then do the ftp in your script. It may that the cron is placing the file someplace else. Do check the root directory or better try and run the find for the file that you want.
# 11  
Old 04-28-2014
Hi

I did a
Code:
find / -type f -name Shipment.csv -print

and I found the file in
Code:
/

. But how come is there, because I am running it from
Code:
30 10 * * * /moneta_polled01/download/./get_dealer.sh

therefore from
Code:
/moneta_polled01/download

directory!!!
# 12  
Old 04-28-2014
Its not "you" that run the script. Its the cron daemon that runs it. And the cwd of the cron daemon is the root directory, unless you change it in your script. In your script you are not changing the directory and hence the file is in /.

It doesnt matter where your script is, what matters is that where you are running the script from.

So better change the directory at the start of your script.
This User Gave Thanks to chacko193 For This Post:
# 13  
Old 04-28-2014
Tnank you, its now working fineSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Cron entry

Hi I have a system running solaris 11, in which I am able to execute a script from the command line, but once I put i the crontab does run, but do not give results. The entry is: 15 11 * * * /var/oswbb/./startOSWbb.sh >> myjob.log 2>&1 30 11 * * * /var/oswbb/./stopOSWbb.sh I have check... (2 Replies)
Discussion started by: fretagi
2 Replies

2. Shell Programming and Scripting

Crontab - entry not working , cron job not running

I have put a cron entry in oracle user for taking hot backup every wednesday@ 2.30 AM and have given the cron entry 30 02 * * 3 /u01/vijay/hotbackupcron 2>&1 >> /u01/vijay/hotbackup.log also find below the script inside hotbackupcron, i have put in env variables as well ... (13 Replies)
Discussion started by: vijaymec50
13 Replies

3. Solaris

cron entry

Hi, I have to add two cron entry now. Please correct me if anything wrong Below script should run at every one and half hour. 30 01 * * * /export/home/gxadm/scripts/collect_mq_info.pl $HOME/GCSS/logs > /dev/null 2>&1 Below script should run at every 2 hours 0 02 * * *... (9 Replies)
Discussion started by: Mani_apr08
9 Replies

4. UNIX for Advanced & Expert Users

cron entry

Hi, I need some clarification on cron entries. I have a cron job like.. 15 01 19 02 6 exec /usr/bin/test.ksh and I have another cron entry added, which is 15 01 20 02 6 exec /usr/bin/test.ksh So, I am thinking the second cron entry shouldn't have run because 02/20 is Sunday, but... (1 Reply)
Discussion started by: everurs789
1 Replies

5. UNIX for Dummies Questions & Answers

cron entry

Can someone please quickly respond to this? I need to have a script test.sh to run every 30 minutes from Monday to Saturday from 6am to 10pm as a crontab entry... Thanks. (3 Replies)
Discussion started by: everurs789
3 Replies

6. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

7. Shell Programming and Scripting

Cron Entry

Hi folks, I have got the following cron entry ... 08 30 * * * /mp1/scripts/test.sh > /mp1/scripts/test_logs.txt 2>&1 The problem is that instead of generating a new test_logs.txt file every time it keeps on appending the outputs to the test_logs.txt file. What is it that I am doing wrong... (2 Replies)
Discussion started by: King Nothing
2 Replies

8. UNIX for Dummies Questions & Answers

cron entry

Hi, Where can we find Cron job logs?i have a cron job which is not executing at all, 00 12 * * * /xx/yy/job > /pp/qq/log if i execute the job alone,it is executing fine. >/xx/yy/job > /pp/qq/log (is executing fine) but its not executing when it triggered from cron.is there any place cron... (7 Replies)
Discussion started by: rujus
7 Replies

9. Shell Programming and Scripting

Cron job entry not running

Hi, I am facing this problem . My Cronjob entry is not running !!! I am having Sun solaris 9 and cronjob entry is "45 1 * * * /safedir/rdns/opt/RDNS1.1Scripts/drpl_audit_log_script.sh_orig > /dev/null 2>&1" Now when I try to look in the output log files it creates, it is some file with... (1 Reply)
Discussion started by: hkapil
1 Replies

10. AIX

Cron entry

Hi All, I want to run a cron job to run on the first saturday of each month at 1:30am. Would the following entry suffice this condition 30 1 6 * 6 wall %Will this work% Appreciate your time. (1 Reply)
Discussion started by: rramanuj
1 Replies
Login or Register to Ask a Question