RE: script to check file size and date stamp

From: Vijay Raghavan (Vijay_Raghavan01_at_infosys.com)
Date: 05/20/03

  • Next message: SolarisSys_at_netscape.net: "RE: Server Recommendation"
    Date: Tue, 20 May 2003 16:59:22 +0530
    To: <sunmanagers@sunmanagers.org>
    
    

    Thanks to MacDonell

    This works fine and is a good solution

    Sorry I missed the bit about the alarm, you could include that with

    #!/bin/sh
    FILE=<file path>
    SIZE=0
    while [ 0 ]
    do
      SIZE=`ls -l $FILE | awk '{print $5}'`
      DATE=`ls -l $FILE | awk '{print $6, $7, $8}'`
      if [ $SIZE -eq 0 ]
      then
        OSIZE=$SIZE
      else
        if [ $OSIZE -ne $SIZE ]
        then
          mailx -s "Alarm: change in file size" user@domain < "The size of
    <file> changed to $SIZE bytes at $DATE"
          exit 1
        fi
      fi
      sleep 300
    done

    exit 0

    Dennis

    -----Original Message-----
    From: Vijay Raghavan [mailto:Vijay_Raghavan01@infosys.com]
    Sent: Tuesday, 20 May 2003 14:40
    To: sunmanagers@sunmanagers.org
    Subject: script to check file size and date stamp

    Hi gurus

    I need a script to check the date stamp and the size of a file continoulsy
    every 5 minutes and give an alarm

    if anything changes in that file.

    Will summarize

    VIJAY
    _______________________________________________
    sunmanagers mailing list
    sunmanagers@sunmanagers.org
    http://www.sunmanagers.org/mailman/listinfo/sunmanagers
    _______________________________________________
    sunmanagers mailing list
    sunmanagers@sunmanagers.org
    http://www.sunmanagers.org/mailman/listinfo/sunmanagers


  • Next message: SolarisSys_at_netscape.net: "RE: Server Recommendation"

    Relevant Pages

    • Re: Rename files to match date stamp
      ... of .jpg files in specified folder to match their date stamp? ... The script below will do what you want. ... basename of a number of .jpg files in specified folder to match their date ...
      (microsoft.public.scripting.vbscript)
    • Re: OT: email woes
      ... OpenVMS system could no longer send SMTP messages to pagers (had been ... This script used to work but now ... making SPAMMERS buy a stamp for each email will ... The onus would be on the sending email client to waste a few ...
      (comp.os.vms)
    • Re: migrated emails are not stamped with user email addresses
      ... You could write a script to muck with proxyaddresses... ... Function StampMembers (strGroupADsPath, dicSeenGroupMember) ... ' if the member is a user then stamp it ... account has the correct email addresses in the AD properties. ...
      (microsoft.public.exchange.admin)
    • Re: Delete Files Based On Date
      ... You still need to concern yourself with what that "date stamp" actually ... script will create an entry for a new file giving the date it was first ... A scheduled task would run another/same script to scan the FTP folder each ... In our case our FTP server. ...
      (microsoft.public.windows.server.scripting)
    • Re: Date stamp notes in contact
      ... If you have the "Other" section of a contact open with the notes pane ... you can use Paul Berkowitz's free "Date Stamp" script to ... quickly insert the date into any text field in Entourage. ...
      (microsoft.public.mac.office.entourage)