Question

Script creates empty file when run from cron in linux

By Gravehourshiftguy ·
Tags: Linux
I have a script as below:
nfsiostat 2 5 > /home/user1/file1; echo " nfsdata" | mail - s " some message" - a /home/user1/file1 xyz@xmail.com

When I run this as. /script, I get the mail with the attachment which has the nfsiostat data, but if scheduled through cron I get a mail with an empty file attached.
Scheduling via cron as below :
*/5 * * * * /location_of_script &2>&1

Any leads on why this is happening and how this may be corrected? Thanks in advance
1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Back to Linux Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums