Update README.md

This commit is contained in:
2025-01-04 03:53:32 +03:00
parent 9acb554dd4
commit 77443e2369

View File

@@ -7,15 +7,17 @@ another, separating them in sub-directories like `$ROOT/year/month/day/`.
I have a smartphone, I have a Syncthing ~~uugh... SmartThing~~ and all photos I have a smartphone, I have a Syncthing ~~uugh... SmartThing~~ and all photos
from smartphone nicely synced to my PC without my attention. But I can't just from smartphone nicely synced to my PC without my attention. But I can't just
keep all photos in synced folder: if I'll clean my phone memory - all photos keep all photos in synced folder: if I'll clean my phone memory all photos
from pc will be cleaned too. I need to not forget copy files in another from pc will be cleaned too. I need to not forget copy files in another
place before cleaning phone's memory. Also, I can't just drop all photos in place before cleaning phone's memory. Also, I can't just drop all photos in
one dir - I will not find anything there later, and a folder with thousands one dir I will not find anything there later, and a folder with thousands
photos looks like a bad idea from either side. photos looks like a bad idea from either side.
So I create this tool in one evening. All it does - copy (or create hardlinks for) So I create this tool in one evening. All it does copy (or create hardlinks for)
files from one place to another, creating basic date-aware directories files from one place to another, creating basic date-aware directories
structure for that files. structure for that files.
Created for own usage and used for a long time without any troubles. But if you meet some —
you are welcomed to the issues.
## Installing ## Installing
```bash ```bash
@@ -31,23 +33,38 @@ sudo cp ${GOPATH}/bin/photocatalog /usr/local/bin/photocatalog
TODO TODO
## Organization modes
Next organization modes supported:
- **copy** — copy files to target root. Make COW (using syscall) if FS supports it.
- **hardlink** — create hardlink to the source file instead of copying.
The best choice if source and target are in same partition for compatibility
and resource usage, but we can't chmod target files, because of original file mode will
be changed too.
- **move** — moves original files to new place.
- **symlink** — create a symlink at the target for the source files.
## Supported formats ## Supported formats
At this moment supported jpeg files with filled exif data or any other At this moment supported jpeg and tiff files with filled exif data and any other
files but with names matching pattern `yyymmdd_HHMMSS.ext`. Such files but with names matching pattern `yyymmdd_HHMMSS.ext` with optional suffixes after a timestamp.
names format applied by android's camera software (I guess all cams Such names format applied by the Android's camera software (I guess all cams
use this format, fix me if I'm wrong). use this format, fix me if I'm wrong).
There is no support for changing names format without modifying source code Jpeg/Tiff files without modification date if exif will be fallen back to the name parsing.
at this time.
No able to change names format without modifying source code for now. Just because
I have reasons to believe that this format is the most popular for the application use cases.
But let me know if you need different timestamp formats support.
## Usage ## Usage
### One-shot ### One-shot
#### Copy files (make a COW if fs supports it) #### Copy files
```bash ```bash
photocalog -mode copy -target ./photos/ -source ./sync/photos/ photocalog -mode copy -target ./photos/ -source ./sync/photos/
``` ```
#### Create hardlinks (only withing one disk partition) #### Create hardlinks
```bash ```bash
photocalog -mode hardlink -target ./photos/ -source ./sync/photos/ photocalog -mode hardlink -target ./photos/ -source ./sync/photos/
``` ```
@@ -57,12 +74,12 @@ photocalog -target ./photos/ -source ./sync/photos/*
``` ```
### Watch mode ### Watch mode
#### Copy files (make a COW if fs supports it) #### Copy files
```bash ```bash
photocalog -mode copy -target ./photos -watch -source ./sync/photos/ photocalog -mode copy -target ./photos -watch -source ./sync/photos/
``` ```
#### Create hardlinks (only withing one disk partition) #### Create hardlinks
```bash ```bash
photocalog -mode hardlink -target ./photos/ -watch -source ./sync/photos/ photocalog -mode hardlink -target ./photos/ -watch -source ./sync/photos/
``` ```