Topic
1 reply Latest Post - ‏2007-01-31T07:06:39Z by SystemAdmin
linuxnewbie
linuxnewbie
1 Post
ACCEPTED ANSWER

Pinned topic Linux Script Help...

‏2007-01-11T20:12:32Z |
I'm trying to create a linux script that does the following. I don't know the syntax so I'm just spelling it out...

IF testfile.txt date/time is greater than System Date/Time + 5hours then send email to x,y and z

It doesn't seem like that hard of a script to put together, I just don't know where to begin.

Any help would be greatly appreciated.

Thanks
Updated on 2007-01-31T07:06:39Z at 2007-01-31T07:06:39Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    232 Posts
    ACCEPTED ANSWER

    Re: Linux Script Help...

    ‏2007-01-31T07:06:39Z  in response to linuxnewbie
    > I'm trying to create a linux script that does the
    > following. I don't know the syntax so I'm just
    > spelling it out...
    >
    > IF testfile.txt date/time is greater than System
    > Date/Time + 5hours then send email to x,y and z
    >
    > It doesn't seem like that hard of a script to put
    > together, I just don't know where to begin.
    >
    > Any help would be greatly appreciated.
    >
    > Thanks

    maybe you can try this:

    #!/bin/bash
    find /path/to/your/testfile -mmin 300
    status=$?
    if $status
    then mail x y z
    fi