Skip to content

russlamb/python-filewatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pattern Watch

Monitor and move incoming files

Overview

This python script will monitor a directory for files with names that match patterns specified and move to a target directory

Default files

The default files used are:

  • pattern_file.py - each line should be a file pattern for files that will be moved. For example, ".xml" for XML files or "something_.xls" for a more specific name.
  • ignore_file.py - each line should be a file pattern for files that will be ignored. For example, "*.lock" to ignore git locks or ".DS_Store" for mac devices.

Other Info

If the folder you're running this code in is managed by git, there can be some funny behavior when it comes to lock files. For this reason the default ignore_pattern.txt file includes *.lock to ignore lock files.

I tested the code using files in a separate directory. You can pass the directory that is to be monitored in the first argument.

Usage

python pattern_watch.py "directory_to_watch" "target_directory" pattern_file ignore_file

About

Watches a directory for new files matching a set of patterns and moves to another directory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages