LiteFS + LiteStream + RClone

Hi I am trying to configure backup of sqlite3 using litefs, litestream and rclone

here are snippets of the config files, as I need some assistance.

litestream.yml

dbs:
  - path: /data/litefs/app.sqlite3
    replicas:
        url: "sftp://${RCLONE_SFTP_USER}:${RCLONE_SFTP_PASS}@localhost:${RCLONE_SFTP_PORT}/db-backup/app.sqlite3"   

litefs.yml

.
.
.
exec:
  # Set the journal mode for the database to WAL. This reduces concurrency deadlock issues
  - cmd: sqlite3 ${DATABASE_PATH} "PRAGMA journal_mode = WAL;"
    if-candidate: true

  # Start rclone to serve the SFTP server for Dropbox backups
  - cmd: rclone serve sftp the-dropbox:/db-backup --user ${RCLONE_SFTP_USER} --pass ${RCLONE_SFTP_PASS} --addr :${RCLONE_SFTP_PORT}
    if-primary: true    
    
  # Start litestream for backup to Dropbox
  - cmd: /usr/local/bin/litestream replicate -config /etc/litestream.yml
    if-primary: true    

  - cmd: dotnet APP.dll
  1. In the litestream.yml file should path be to the litefs mount or the real location of the db file on the fly volume eg “/data/litefs” also when I look into this directory i see it has actually placed the db file on the fly volume in “/data/litefs/dbs”
    What is the correct path to place in litestream.yml

  2. rclone seems to be a long running app, and litestream may be too, so the way i am running them in litefs.yml it never gets past starting rclone.
    What is the better way to start rclone and litestream?

Thanks in advance.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.