Forum Moderators: bakedjake
I am facing problem in executing a shell script thru cron job.If I execute it from putty window it getting executed.
Here is my script:
#! /bin/sh
PATH=$PATH:/usr/sfw/bin
#Copy all the text file to the icb\upd\out folder on the ICB PC in Dublin
#This is performed via SAMBA file copy
smbclient \\\\192.168.56.14\\gex\$ -U conficb%Welcome01 -c "cd \icb\upd\out\; prompt off; mput *.txt"
Here is my crontab entry configured to execute daily at 12:30 PM:
30 12 * * * /ecomm/iplanet/nes60/smbcopy.sh >> /ecomm/iplanet/nes60/trace.log
The job is getting triggered properly.This I know as I can see the time stamp of trace.log as 12:30 daily updated.
Can you please advise me on this?
Thanks,C
*.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..
*.txt: No such file or directoryActually 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"
smbclient \\\\192.168.56.14\\gex\$ -U conficb%Welcome01 -c "lcd (local_path); cd \icb\upd\out\; prompt off; mput *.txt"