I can't make a backup

Hello everyone! I have an issue with creating a backup. By following the official guide it says to enter this command:

sqlite3 data/db.sqlite3 ".backup '/path/to/backups/db-$(date '+%Y%m%d-%H%M').sqlite3'"

By entering this command I’m getting Error: cannot open “/home/ubuntu/vw-backup/db-20220809-1220.sqlite3”


here’s the command I’m using:

sqlite3 /opt/vaultwarden/vw-data/db.sqlite3 ".backup '/home/ubuntu/vw_backup/db-$(date '+%Y%m%d-%H%M').sqlite3'"

where, /opt/vaultwarden/vw-data is the location of my files, and /home/ubuntu/vw_backup/ a place to store the backups


P.S. vw-data is mentioned in volumes docker-compose

volumes:
      - ./vw-data:/data

and the folder vw_backup exist!

ubuntu@vaultwarden:~/vw_backup$ pwd
/home/ubuntu/vw_backup

Does the user who executes that command have the correct rights to both locations?
Also, does that folder have the correct chmod rights?

If that is not valid, then the sqlite3 utility can’t access or create a file there, and will cause this specific error message

i’ve tried with sudo and still no luck

To me works, follow command line below:

sqlite3 data/db.sqlite3 ".backup $(date '+%Y%m%d-%H%M').sqlite3"

1 Like