[root@rhel5 ~]#chkconfig --list | sendmail -F "List Out all the Server" email@example.com
-F refers To The From Address.
send the mail with the particular text document
sendmail firstname.lastname@example.org < /etc/crontab
Add Entry In cron tab
#0 2,13 * * * /sbin/ping -c 10.0.0.1; ls -la >>/var/log/cronrun
It will execute ping and ls -la command at 2AM and 1PM and it will put the output of command into the log file /var/log/cronrun
it will store the shell script output to the corresponding file /tmp/backup.log file.
Redirect to output
Redirect to error
Redirect to error to standard output
Redirect to input
Pipe standard output to another command
Append to standard output
Pipe standard output and standard error to another command