No description
| cmd | ||
| internal | ||
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
DAM - A file shuffler
Bridges the gap for a one way file sync between devices that have different folder structures.
Functionality
- Dam is designed to help syncing photos between my phone and my server
- The two devices use radically different folder structures
- The phone stores all photos in the same level (root of synced folder)
- The server stores photos using the following layout:
(photodir)/YYYY/MM/(all photos for said year and month) - Dam must take all the photos (and videos) in the source directory and hardlink the files to the server's photodir, using the correct file layout
- Dam takes two folder paths as command line arguments
- One is the synced phone folder
- The other is the destination
- Dam parses the EXIF data of the various files to determine file dates
- Dam uses Linux filesystem watching, to process new images in the synced folder
- Dam checks the destination before hardlinking the file.
- If the file already exists, it check if it is an hardlink
- If it's not an hardlink it checks if the file sizes differ.
- If the file sizes differ, it renames the the old file, adding a suffix. It then creates the hardlink
Usage
go run ./cmd/dam
External libs:
- cobra: cli parsing
- fsnotify: filesystem watching
- go-libexif: exif parsing
TODO
- Concurrency
- Split into sync and watch commands
- Configurable Exiftool path
- Config file