Dsh command : Execution Problems with Cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Dsh command : Execution Problems with Cron
# 1  
Old 03-29-2012
[solved] Dsh command : Execution Problems with Cron

Hi,

On linux cluster, i created a script to delete all temp files older than 5 days.

i am able to execute the script "dsh -ea script.ksh" in management node directly
But when i schedule "dsh -ea script.ksh" in crontab in management node it tells dsh command not found.

How to solve this issue?

error :

Code:
/root/tmpdeletion_adm.ksh: line 2: dsh: command not found


Moderator's Comments:
Mod Comment Please use code tags!

Last edited by zaxxon; 03-29-2012 at 11:14 AM.. Reason: code tags
# 2  
Old 03-29-2012
That's a very common problem - when issuing a script via cron, you don't have the environment set like when being logged in with your user. Variables like PATH might be empty or set different. So you will have to use absolute paths or source environment files etc., up to you.
Here is a link to an detailed explanation about using cron:
https://www.unix.com/answers-frequent...n-crontab.html
# 3  
Old 03-29-2012
Hi zaxxon,

Thanks.i have used

Code:
entire/path/dsh -ea script.ksh

and it works fine.

in crontab Smilie

Last edited by zaxxon; 03-29-2012 at 04:05 PM.. Reason: code tags
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Execution Problems with Cron

Good evening, ive got this cron to be run: if i run this manually it doesnt work,it takes me to the prompt again /export/app/CO/opge/scr/Informe_parametros_colombia.ksh >/dev/null 2>&1 here is the code fragment: coopge@coopge: opge PRODUCCION>more... (1 Reply)
Discussion started by: alexcol
1 Replies

2. Shell Programming and Scripting

Wall execution problems from cron

So I've been tasked with creating a shell script to run in a cron every few minutes to check duplex settings on my eth0 nic card. I would like for the server to send a wall message to whoever is on the console or in a terminal session. Below is what I have so far. 0,10,20,30,40,50 * * * * ... (7 Replies)
Discussion started by: lutador72
7 Replies

3. SuSE

Wall execution problems from cron

So I've been tasked with creating a shell script to run in a cron every few minutes to check duplex settings on my eth0 nic card. I would like for the server to send a wall message to whoever is on the console or in a terminal session. Below is what I have so far. 0,10,20,30,40,50 * * * * ... (1 Reply)
Discussion started by: lutador72
1 Replies

4. Shell Programming and Scripting

Execution problems with cron

I am new to creating crontab file , i just wrote below (40 19 * 3 * /root/maths/practisecron.sh), the script just prints "Hi". When ever i save the above file i am getting this . # crontab -e crontab: installing new crontab Can you please check where it went wrong.. (1 Reply)
Discussion started by: vkiyv05
1 Replies

5. UNIX for Dummies Questions & Answers

Execution Problems with Cron

Hi friends, today i created a cron job , registered the crontab file associated but dont know why the cron is not getting executed at the right time.?? content of Crontab file : 21 15 * * * /subrat/myt i wanted to execute the script myt on 15:21 PM of everyday. the script myt... (2 Replies)
Discussion started by: paras.oriental
2 Replies

6. Shell Programming and Scripting

Execution Problems with Cron

Hi, I have written a shell script to transfer files to a SFTP server passing the filername, source and dest directory as parameters and it runs well. :) I want to schedule this script to run periodically using a cron job. root@pingu # cat /etc/crontab SHELL=/bin/bash... (1 Reply)
Discussion started by: chetancrsp18
1 Replies

7. UNIX and Linux Applications

Execution Problems with Cron

Hi all!! I have a nerve-wracking concept (probably for me!!) which is not understood. My crontab entry looks this way. 33 09 22 3 * /home/myexp.sh "Bgp4 ALL" >/dev/null 2>&1 But cron gets started occasionally. Sometimes it does. Sometimes it does not. And sometimes it hangs in the middle (I... (1 Reply)
Discussion started by: dhivyasuresh
1 Replies

8. Programming

execution problems with cron

how to store a date into file? and how we can access date from the file? ---------- Post updated at 06:09 AM ---------- Previous update was at 06:08 AM ---------- how we can store date in file? (1 Reply)
Discussion started by: causalmodi777
1 Replies

9. Shell Programming and Scripting

Execution problems with comm command

I tried to compare two sorted files with comm command which contain floating values as: RECT 0 9.8 8.70 7.8 in first file & RECT 0 9.80 8.7 7.80 in second file. comm -3 first_file second_file should give a empty file but it does not. Is there a way to compare these two files correctly... (4 Replies)
Discussion started by: nehashine
4 Replies

10. Shell Programming and Scripting

Execution problems using awk command.

Hi All, I have the following requirement. In a directory i get files from external source. I at regular intervals check that directory for any incoming files. The file name is underscore delimited. Such as: aaa_bbb_ccc_ddd_eee_fff.dat I am using awk and and splitting the file name. ... (4 Replies)
Discussion started by: satishpv_2002
4 Replies
Login or Register to Ask a Question