phranque

msg:3261410 | 1:52 pm on Feb 23, 2007 (gmt 0) |
i would first check to make sure $PATH is correct for the cron job...
|
chanu

msg:3261443 | 2:17 pm on Feb 23, 2007 (gmt 0) |
Thanks phranque. Infact I had put echo $PATH in my code and this is the output that comes up when cron job executes. /usr/bin::/usr/sfw/bin and I made sure that smbclient that I am using is available in /usr/sfw/bin.
|
phranque

msg:3262201 | 11:58 pm on Feb 23, 2007 (gmt 0) |
next i would check ownership and permissions. "whoami" for the cron job and the owner/permission settings of the executable and directories being accessed. are you getting an actual error message or just nothing happens?
|
chanu

msg:3269130 | 4:14 pm on Mar 2, 2007 (gmt 0) |
I have checked the file permissions as well. everything seems to be fine. I have redirected the output and errors to a text file and here is the error message that I get in the log *.txt: No such file or directory Actually in my code I have used the following statement: smbclient \\\\192.168.56.14\\gex\$ -U conficb%Welcome01 -c "cd \icb\upd\out\; prompt off; mput *.txt" The task of this is to transfer all text files available in this directory to another server. I think it is searching for a file with a name *.txt instead of considering all files with txt extension. My question here is how to make Unix understand that its the pattern here. But when i directly run the shell script on command prompt it considers it in the right way. Not sure why this behavior when its executed thru cron job. Please help me..
|
phranque

msg:3269672 | 2:52 am on Mar 3, 2007 (gmt 0) |
| *.txt: No such file or directory Actually in my code I have used the following statement: smbclient \\\\192.168.56.14\\gex\$ -U conficb%Welcome01 -c "cd \icb\upd\out\; prompt off; mput *.txt" |
| is that error coming from the shell script or from smbclient? the double quotes should escape the wildcard character from the shell script, so it should not be trying to expand *.txt in the script. if the message is coming from smbclient, make sure you have the cron job set the directory to what ever directory you want to send *.txt from. you can do this either in the shell with a cd command or i assume you can do it in smbclient with lcd. this would be the directory you were in when you "directly run the shell script on command prompt". | smbclient \\\\192.168.56.14\\gex\$ -U conficb%Welcome01 -c "lcd (local_path); cd \icb\upd\out\; prompt off; mput *.txt" |
|
|
chanu

msg:3272744 | 4:50 pm on Mar 6, 2007 (gmt 0) |
Thanks a ton phranque! Your solution worked :-). Actually going to local directory in the script worked.
|
|