No description
Find a file
Alessandro Bernardello 4096beb664
refactor: go mod tidy
2025-03-21 22:33:04 +01:00
cmd refactor: go mod tidy, remove unused module 2025-03-18 15:59:09 +01:00
internal fix: working folder watching 2025-03-21 22:32:05 +01:00
.gitignore refactor: error handling utility functions 2025-01-04 21:50:53 +01:00
go.mod refactor: go mod tidy 2025-03-21 22:33:04 +01:00
go.sum refactor: go mod tidy 2025-03-21 22:33:04 +01:00
LICENSE Initial Commit 2025-01-03 17:52:30 +01:00
main.go Initial Commit 2025-01-03 17:52:30 +01:00
README.md docs: add TODO list to readme 2025-01-06 01:40:01 +01:00

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