Send output of a command as an email

Hello Unix Experts!

We are on AIX 6.1 TL6

I am trying to develop a script that does the following:

It should send the output of "df -g /directory/folder" command as an email to a user(someone@company.com)

This is too simple and i can research on how to do it, but it would be great if someone can give me the code for this.

Thanks!

---------- Post updated at 04:12 PM ---------- Previous update was at 04:11 PM ----------

We need to put that script in the crontab, so i just need the code for the above logic

Thanks so much !!!

df -g /directory/folder | mailx -s "Disk Free" someone@company.com
1 Like

Thanks a ton! for your help :slight_smile: