A golang program to constantly listen for USB mic audio and transport generated files to a remote destination for safe keeping via SSH
LOCAL_DIR=go-listen-recordings REMOTE_HOST=rasp-pi REMOTE_HOST_DIR=~/go-listen-recordings go run main.go
- Creates directory for current date and next couple of days ahead of time
- List old directories (older than todays date)
- Check if old directory already exists on remote destination
- If directory exists, check if all the files in it match check sum with local
- If folder does not exist or checksum mismatch, copy entire folder again
- Post copy, do verification of remote folder again and if successful, delete the local folder
- If all directories older than today is copied to remote host, wait for 30mins and goes to step 1
- Make SCP errors independent of ffmpeg audio collection
- Exponential back off and retry when NAS is down
- When disk space is running low delete oldest recordings (file rotation)