Sign inSign up

gkarthics/file-watcher

By gkarthics

•Updated over 5 years ago

Watches the specified file & triggers an email with changes to specified address.

Image
1

1.6K

gkarthics/file-watcher repository overview

⁠Simple node watcher

This simple node-watcher will watch for the change in the file specified via FILE_LOCATION and triggers an email with the data that's been changed.

⁠ENV parameters:

Environment VarialbeDescription
SMTP_HOSTsmtp host address
SMTP_PORTsmtp host port number
TO_ADDRESSReceiver's address
FROM_ADDRESSFrom address
FILE_LOCATIONlocation of the file to watch for.

⁠Docker

To use this image as a docker, follow the below steps.

docker run --name file-watcher -e SMTP_HOST=<domain.com> -e SMTP_PORT=<25> -e TO_ADDRESS=<[email protected]> -e FROM_ADDRESS=<[email protected]> -e FILE_LOCATION=<LOCATION_OF_FILE> -d gkarthics/file-watcher

⁠Kubernetes Pod

To use this image in kubernetes, below is a sample pod configuration file. This image can be used in parallel with someother images to watch the file changes made.

apiVersion: v1
kind: Pod
metadata:
  labels:
    app: file-watcher
  name: file-watcher
spec:
  containers:
  - image: gkarthics/file-watcher
    name: file-watcher
    env:
      - name: SMTP_HOST
        value: <smtp.domain.com>
      - name: SMTP_PORT
        value: 25
      - name: TO_ADDRESS
        value: <[email protected]>
      - name: FROM_ADDRESS
        value: <[email protected]>
      - name: FILE_LOCATION
        value: </data/data.txt>
    volumeMounts:
      - name: data
        mountPath: /data
  volumes:
  - name: data
    emptyDir: {}

Tag summary

Content type

Image

Digest

Size

14 MB

Last updated

over 5 years ago

docker pull gkarthics/file-watcher