root@example:~/.ssh# kopia repository create sftp --path=./backups/kopia/test --host=example.rsync.net --username=example --keyfile=/root/.ssh/id_ed25519 --known-hosts=/root/.ssh/known_hosts
Enter password to create new repository:
Re-enter password for verification:
Initializing repository with:
block hash: BLAKE2B-256-128
encryption: AES256-GCM-HMAC-SHA256
splitter: DYNAMIC-4M-BUZHASH
Connected to repository.
NOTICE: Kopia will check for updates on GitHub every 7 days, starting 24 hours after first use.
To disable this behavior, set environment variable KOPIA_CHECK_FOR_UPDATES=false
Alternatively you can remove the file "/root/.config/kopia/repository.config.update-info.json".
Retention:
Annual snapshots: 3 (defined for this target)
Monthly snapshots: 24 (defined for this target)
Weekly snapshots: 4 (defined for this target)
Daily snapshots: 7 (defined for this target)
Hourly snapshots: 48 (defined for this target)
Latest snapshots: 10 (defined for this target)
Ignore identical snapshots: false (defined for this target)
Compression disabled.
To find more information about default policy run 'kopia policy get'.
To change the policy use 'kopia policy set' command.
NOTE: Kopia will perform quick maintenance of the repository automatically every 1h0m0s
and full maintenance every 24h0m0s when running as root@example.
See https://kopia.io/docs/advanced/maintenance/ for more information.
WARN unable to write diagnostics blob: unable to complete PutBlob(_log_20240929112901_1ff3_1727605741_1727605753_1_87bb58ec4fa77aea11bc866c6add7128) despite 10 retries: cannot create temporary file: cannot create directory: can't re-create top-level directory ./backups/kopia/test: top-level directory not found
ERROR error populating repository: error flushing writer: error flushing manifests: unable to write content: unable to create pending pack: unable to get session ID: unable to write session marker: unable to write session marker: s8c587722df979bb11cd5dbd635ffe711-s0ca56713703d729612d: unable to complete PutBlob(s8c587722df979bb11cd5dbd635ffe711-s0ca56713703d729612d) despite 10 retries: cannot create temporary file: cannot create directory: can't re-create top-level directory ./backups/kopia/test: top-level directory not found
You would actually need to look at the logs from your FTP server, as it seems that there’s a permission error at that end. Kopia is only reporting its inability to write to that SFTP target.
Alright. On the provider I am using they don’t allow root access but via an account I am given.
Although, on the machine I wish to backup from is using the root user to perform the backup while the machine I wish to back to is using a specific non root user. Could that effect it?
Forget kopia for a moment and try with whatever ftp client you prefer (e.g. FileZilla). Does it work? Can you create dirs and send files? Using the same credentials you tried with kopia. If does not work then you have to solve your sftp access first.
So. I have tried via Username and Password and I was able to create and upload files using my storage provider account. Let me give public key authentication in Filezilla a try.