Skip to main content

Monitor directories for new files and add tombstone file when static

Project description

tombstone

tombstone is a simple class that examines subdirectories under a base directory at a specified level. The last modified time is determined for each subdirectory and if the subdirectory is older than the provided threshold, a "tombstone" file is added to mark the directory as static. This is indended to help monitoring directories that are receiving data but lack other criteria to determine when the transfer is complete.

Features

  • Set the desired level of subdirectories to monitor
  • Set the depth at which subdirectories are probed to determine the time of most recent mtime
  • Set the desired filename to be used as a tombstone
  • Set the "age" at which a tombstone is created

Installation

You can install the package via PyPI or from source

Intsall from PyPI

pip install tombstone

Install from Source (github)

git clone https://github.com/jeffduda/tombstone.git
cd tombstone
pip install .

Usage

After installation you can use 'Tombstone' to monitor subdirectories for most recent mtime

Example

from tombstone import Tombstone

t = Tombstone(directory="/My/Base/Dir",level=1,depth=2,threshold=60)
stones = t.update(True)

for s in stones:
    print(f"Created tombstone: {s}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tombstone-0.1.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tombstone-0.1.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file tombstone-0.1.1.tar.gz.

File metadata

  • Download URL: tombstone-0.1.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.10

File hashes

Hashes for tombstone-0.1.1.tar.gz
Algorithm Hash digest
SHA256 acba9f5fdb60c0fb89e9e55798e81c04516a8d6ca231f2d821992a87853628c4
MD5 a868658504c072530d17e1c930995914
BLAKE2b-256 cb5ac084f82777e0ed209c976feb063e32f868167ff0938155343fe766e6db1d

See more details on using hashes here.

File details

Details for the file tombstone-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tombstone-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.10

File hashes

Hashes for tombstone-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 124cf5e28cb35fd384c17bca979d4e1e36c2822c2ab52fda8ef35a172a00b6fc
MD5 18fc4ae89addb5c82af36c69eb0d73c8
BLAKE2b-256 9afad43d3ac45616d9c1f80e495a3fde897420f776151e48a070f27c8a23bb0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page