Have a simple script to run the top comman nand to save the result in a txt file. He will start the cycle 3 times a day with a 1-hour interval. After that, the email will be sent using the contents of the text file as the body of the email and delete the text file so that a new text file appears the next day.
Problem
- To automate the process, I created a cronjob to start at 8:30 pm, which will run the script, and my script will continue to run for 4 hours, and the result of the command will be added to the text file and finally sent by mail. CRON is →
0 10 * * * /tmp/ssh-abc/KKK/Report.sh/tmp/ssh-abc/KKK/Report.sh: line 34: ReportProd.txt: Permission denied
The codeTo create a txt file
{
} >> ReportProd.txt
Delete the file after distribution.
find /tmp/ssh-abc/KKK/*.txt -type f -delete //This works fine manually,file is getting generated and deleted also.
/tmp/ssh-abc/KKK/Report.sh: 39: ReportProd.txt:
, ? , .
0755 cron - .
Tried giving cd and path and then the command in crontab but seems not working
: #!/bin/ bash "whereis sh" sh:/bin/sh/usr/share/man/man1/sh.1.gz/USR///man1p/sh.1p.gz