I use Litestream for offsite backups. SQLite also has a .backup command:
sqlite3 /path/to/db '.backup /path/to/backup'
or
sqlite3 /path/to/db "VACUUM INTO '/path/to/backup'"