Skip to content

coonty98/AutoDirectory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

The idea for this project came from a script utilized in a previous job. In a shared directory, folders that were deleted would automatically be recreated and certain files would be merged from several folders into one. It was an interesting idea, so I decided to recreate that behavior with my own implementation.

Watchdog

The core of this script is the Watchdog module which essentially watches a specified directory for changes, then executes certain actions.

  • When a folder is deleted or renamed, the original will be recreated.
  • When a file is created, it will be moved to another folder if specified.

SQL

I use a Microsoft SQL Server database to store a list of Folders that I want to always be in the specified location. Whenever a creation/modification/deletion event occurs in the root location, the maintain() function is called and the SQL table is queried and missing folders will be recreated.

There is another column in the table that indicates a Merge location. If I want files from certain folders to be put in a single folder, it is entered here. Then, every time a file is added in the 'source' folders, it will trigger the merge() function and move that file to the proper folder.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages