Skip to main content

Scripts for managing media

Project description

search-fs

A simple python utility that indexes directory and file names in a sqlite database to allow for fast searching.

Definitely check out locate before considering this tool.

Installation

pip install search-fs

Usage

create-search-fs --help
search-fs --help

Create the database

create-search-fs dir1/ dir2/

Search

Search anywhere for JPG files

search-fs --name '*.jpg'

Search just one directory tree for JPG files

search-fs --name '*.jpg' dir1/

Search just one directory and not any of the sub directories for JPG files

search-fs --name '*.jpg' dir1/ --strict-dir

Search for directories

search-fs --name 'Directory*' --type d

Search for files by size

search-fs --size '500M' #Files larger than 500MB
search-fs --size='-10M' #Files smaller than 10MB, Note: make sure you use use '--size=' for less than

Cron

You can setup a cronjob to run create-search-fs so that the index is up to date.

Create dirs.txt which contains the directories to index

#Lines starting with # are ignored
/path/dir1
/other/dir2

Add line with crontab -e to update the index every hour

0 * * * * /usr/local/bin/create-search-fs --dirs /path/to/dirs.txt

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

search-fs-0.0.3.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

search_fs-0.0.3-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file search-fs-0.0.3.tar.gz.

File metadata

  • Download URL: search-fs-0.0.3.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for search-fs-0.0.3.tar.gz
Algorithm Hash digest
SHA256 66acf5ff97c98bed0d66a8e605da02c3c3d6f83a23ae6f9c0b64af116e34b042
MD5 f38aa7e3c753988c7b8b89f11256262a
BLAKE2b-256 c031ae45055158c46a74d7496a28da5306f04148c78f5da56489a61eeb70291d

See more details on using hashes here.

File details

Details for the file search_fs-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: search_fs-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for search_fs-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 37aa9bc6aaf6ffa1e49e2692b58329997cac53a9960e61896f339ed47b853a76
MD5 a7cf3b4a90733810f8c59ea80712841e
BLAKE2b-256 5ce13d26cea17527de8827285a61cd2303a5968e5606b46bd0f0441a3dbb34c4

See more details on using hashes here.

Supported by

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