Line one may have a leading space.
the directory /scripts may not be accessible.
Line 4 the file alarm.log.$(DATE) might not exist or be readable
Line 8, HOSTNAME is not defined. You probably mean $(hostname)
Can you provide more detail on how exactly the script is not working, please ? Are you getting an error, and if so, what is the full text of the error ? If you are not getting an error as such, then if you could explain exactly what is going wrong, perhaps someone here will be able to assist you further. But either way, we'll need to know what the problem and nature of the failure actually is first.