Skip to content

pedroamador/checkfiledate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check file date

The aim of "checkfiledate" is to search for new files in a specific directory, and send an alert email under certain conditions

Requisites

You must install a mail server (like "sendmail", "exim", "postfix"), a mail client (like "mail") and "find" plus "egrep" utilities.

Use mode

  1. Create a file called "filelist.txt" (there is a template in "filelist.txt.dist" with instructions)

  2. Create a file called "maillist.txt", with one mail address per line

  3. Create a crontab that execute "checkfiledate.sh"

    root@local:~# cat /etc/cron.d/checkfiledate

    m h dom mon dow user command

    00 00 * * * root /opt/checkfiledate/checkfiledate.sh > /var/log/checkfiledate.log 2>&1

  4. Stay tuned to your mail inbox!

There is two posible parameters:

  • mailtest => Send email to al target address in "maillist.txt"

    $ ./checkfiledate.sh mailtest

  • dryrun => Do the check, but without sending any mail

    $ ./checkfiledate.sh dryrun

Weekly test email

If you run the script in the weekday 0 (sunday), it send a "checkpoint" mail with "WEEKLY TEST EMAIL" subject

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages