Scheduling shell Script to check memory usage & automated email notification

1)Create a .sh file


[root@ystbckp ~]# vim script_memory.sh

2)Write a the following script in the script_memory.sh file


Schedulng a shell

3)Change the permission to the script_memory.sh file


[root@ystbckp ~]# chmod 744 script_memory.sh

4)Scheduling the file to execute on a particular time


[root@ystbckp ~]# crontab -e

Each entry in a crontab file consists of six fields, specified in the following order

Minute hour day month weekday command
05 * * * * sh /root/script_memory.sh

When an asterisk (*) is displayed, it means all possible values for the field. For example, an asterisk in the hour time field would be equivalent to "every hour"

0 comments:

Post a Comment