DietPi-Backup/Sync | Add network target support
Ref: https://dietpi.com/forum/t/backup-and-restore-to-network/2782
Should be easy to apply, since we use rsync already with native network support:
- New menu entry: Add network target
- Add host/URL > G_CHECK_URL > Add credentials > dry run/creds check? > store info/sync
Hmm, currently we have a separate NFS mount choice, by simply using /mnt/nfs_client local mount dir. Wouldn't it be easier to just have all network drives integrated into dietpi-drive_manager 2 list, if this is not already the case?
But interesting indeed would be network targets via rsync:// ftp:// sftp:// protocol directly within rsync command. E.g. not sure if SFTP can be even mounted as a drive, but sometimes you only want to have this single sync done to a certain server, while you don't need it permanently mounted.
rsync natively supports SSH ([-p PORT] ... [USER@]HOST:DEST) and remote rsync daemon (rsync://[USER@]HOST[:PORT]/DEST) only.
But SSH authentication needs to be done interactively (hence no daily backup), unless key authentication is used. -e 'dbclient -i "/path/to/id_file"' is needed when Dropbear is used locally (no OpenSSH client (=ssh command) installed), or ~/.ssh/id_dropbear as default private key location for dbclient, and in special format. To convert, e.g.:
dropbearconvert openssh dropbear /root/.ssh/id_ed25519 /root/.ssh/id_dropbear
Remote rsync daemon connections can be automated via RSYNC_PASSWORD environment variable.
Everything else needs to be done via mounts. Also possible with via SSH>SFTP wih sshfs.
Would love to have rsync server as a dietpi-backup destination