0

Hi Guys,

I'm quite new to shell scripting. I would like to create a script to the following:
1. dbf
2. Print "Filesystem" "kbytes" "used" "avail" "%used" "Mounted on" values where %used >= 80%.
3. email output to user(you@email.com)
4. The script should run once a day via cron every 10PM.

Hope to receive your reply soon guys... thanks in advance...

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by sn4rf3r
0

Hi Guys,

I'm quite new to shell scripting. I would like to create a script to the following:
1. dbf
2. Print "Filesystem" "kbytes" "used" "avail" "%used" "Mounted on" values where %used >= 80%.
3. email output to user(you@email.com)
4. The script should run once a day via cron every 10PM.

Hope to receive your reply soon guys... thanks in advance...

Put this into a file

#!/bin/bash
echo `df -h` | mail you@example.com

run these commands
chmod a+x myscript #make the file executable

crontab -e #edit the crontab

Then add this to the crontab:
0 22 * * * /home/me/myscript

make sense?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.