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
Release history Release notifications | RSS feed
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.2.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for search_fs-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2280505740e5ef745849215958361f251a7a04206afa82a3dc16375575f4ecd2 |
|
MD5 | 5187c9b6f036e737bafe6ed10e256621 |
|
BLAKE2b-256 | 763840d9c08d584ffa23c3911f4b9f82c2daa4bf10fdec7a30cbcb462ab2ece9 |