I want to have a mirror of my local music collection on my server, and a script that periodically updates the server to, well, mirror my local collection.

But crucially, I want to convert all lossless files to lossy, preferably before uploading them.

That’s the one reason why I can’t just use git - or so I believe.

I also want locally deleted files to be deleted on the server.

Sometimes I even move files around (I believe in directory structure) and again, git deals with this perfectly. If it weren’t for the lossless-to-lossy caveat.

It would be perfect if my script could recognize that just like git does, instead of deleting and reuploading the same file to a different location.

My head is spinning round and round and before I continue messing around with find and scp it’s time to ask the community.

I am writing in bash but if some python module could help with it I’m sure I could find my way around it.

TIA


additional info:

  • Not all files in the local collection are lossless. A variety of formats.
  • The purpose of the remote is for listening/streaming with various applications
  • The lossy version is for both reducing upload and download (streaming) bandwidth. On mobile broadband FLAC tends to buffer a lot.
  • The home of the collection (and its origin) is my local machine.
  • The local machine cannot act as a server
  • solrize@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    3 days ago

    Not sure what you’re asking, but can you use git hooks? What is the purpose of the mirror: for backup, for remote listening, or what? If the mirror is the permanent home for the files, you should keep the lossless version there. Is the lossy conversion just to reduce upload bandwidth? How did you get the lossless files onto the client to begin with?

    If I imagine this setup, the lossless versions would live on the server, lossy compression would also be done on the server, and then the client could download either version.

    I think version control isn’t really what you want, since you normally won’t have multiple revisions of the same file.

    Maybe you could look at git-annex for handling the large binaries in your git repo.

    • A_norny_mousse@feddit.orgOP
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      The mirror is for remote listening and streaming, yes.

      The lossy version is for both reducing upload and download (streaming) bandwidth. On mobile broadband FLAC tends to buffer a lot.

      No, the home of the collection (and its origin) is my local machine.