Jewel
April 13, 2013, 1:38am
1
Hi Friend,
i have tried to generated zip file and received with attached mail by. But attachment file is unrecognized format not zip file by crontab, which is not able open.
but there is no issue when the script is ran manually but i have received zip format.
i am appriciate for your valueable input through forum.
Thanks,
Jewel
If your job/script works outside of a crontab but fails for whatever reason when run from crontab, it typically means that some component of your regular environment is missing or incorrect. The most common is probably an incorrect PATH.
Jewel
April 13, 2013, 3:08am
3
i have put all the corrct path. Please let me know how to fix it.
Thanks,
Jewel
Where did you set your PATH? Please provide samples/examples..
Jewel
April 13, 2013, 5:11am
5
(uuencode /rep/p31100/users/repP3ap/rabindra/TransfersReport/CancelPending/$filename1 /rep/p31100/users/repP3ap/rabindra/Tran
sfersReport/CancelPending/$filename1 ; cat $cspath/pendingbody.txt)| mailx -m -s "Cancelled and Pending status Report" "${CLI
ST%,}"
uuencode does not have a path for example, nor mailx etc.. You need to provide the PATH somehow.. Do a search or read the FAQ
Jewel
April 13, 2013, 11:41am
7
can you please clear me more to avoid this issue
---------- Post updated at 10:41 AM ---------- Previous update was at 04:42 AM ----------
Hi Friend,
can you please help on this.
Thanks,
Jewel
Yoda
April 13, 2013, 11:50am
8
Do not 'bump up' questions if they are not answered promptly.
What Scrutinizer meant is to use absolute path for utilities uuencode
and mailx
Get absolute path using which
command:
which uuencode
which mailx
Replace absolute path in your script.
If this does not help, set xtrace and verbose and redirect script output to another file to debug what is going on:
* * * * * /path/script.sh > /path/debug.log
Jewel
April 13, 2013, 1:04pm
9
Thanks Yedi
but you meant to say.should i use like this in my script
(/usr/bin/uuencode 04-04-2013.csv.gz 04-04-2013.csv.gz )| mailx -m -s �Cancelled/Pending report� jewel@xyz.com
correct me if i am wrong.
Thanks,
Jewel
Jewel
April 16, 2013, 12:57pm
10
now my script is working fine.
Really thanks to all my friend for sharing message.
1 Like