How do I solve the error "execv: No such file or directory" from rsync?
I'm trying to back up several machines to a linux server using rsync and it's working in most scenarios:
- path-to-path rsync backup of the server itself
- rsync on the server to get files from windows remotes running cygwin-rsyncd
What doesn't work is backing up my Android phone (running SimpleSSHD) using rsync-via-ssh. At least, not in any way that is initiated by the server, which is my goal.
- server: Gentoo Linux, hostname "crucible", ip 192.168.7.94
- phone: LineageOS on HTC One M8, hostname "rondel", ip 192.168.7.33
Here's a breakdown of what works and what doesn't, and how.
- On the server, opening ssh into the phone, and from there, opening ssh back to the server: WORKS
aeheathc@crucible ~ $ ssh -i /home/aeheathc/.ssh/id_rsa -p 2222 -l backuppc rondel
:/ # ls
[phone file listing]
:/ # ssh -i /data/smbrw_key -p 22 -l smbrw 192.168.7.94
Could not create directory '/.ssh'.
The authenticity of host '192.168.7.94 (192.168.7.94)' can't be established.
ECDSA key fingerprint is SHA256:[random stuff here].
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Failed to add the host to the list of known hosts (/.ssh/known_hosts).
smbrw@crucible ~ $ ls
[local server file listing]
- On the server, using rsync via ssh to get files from the phone: ERROR, "execv: No such file or directory"
aeheathc@crucible ~ $ rsync -a --progress --delete -e "ssh -i /home/aeheathc/.ssh/id_rsa -p 2222" backuppc@rondel:/storage/emulated/0/ /backup/redundinator/hosts/rondel/paths/_storage_emulated_0
execv: No such file or directory
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) [Receiver=3.2.3]
- On the phone, using rsync to push files to the server via its rsyncd: WORKS
aeheathc@crucible ~ $ ssh -i /home/aeheathc/.ssh/id_rsa -p 2222 -l backuppc rondel
:/ # rsync -a --progress --delete --password-file=/storage/emulated/0/rsync_backup_crucible /storage/emulated/0/ rsync://[email protected]/backup/redundinator/hosts/rondel/paths/_storage_emulated_0
sending incremental file list
[normal rsync progress output]
- On the phone, using rsync to push files to the server via ssh: WORKS
aeheathc@crucible ~ $ ssh -i /home/aeheathc/.ssh/id_rsa -p 2222 -l backuppc rondel
:/ # rsync -a --progress --delete -e 'ssh -i /data/smbrw_key -p 22' /storage/emulated/0/ [email protected]:/mnt/backup/redundinator/hosts/rondel/paths/_storage_emulated_0
Could not create directory '/.ssh'.
The authenticity of host '192.168.7.94 (192.168.7.94)' can't be established.
ECDSA key fingerprint is SHA256:[random stuff here].
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Failed to add the host to the list of known hosts (/.ssh/known_hosts).
sending incremental file list
[normal rsync progress output]
- On the server, using a command that opens ssh to the phone and runs a command there to rsync files back to the server (connecting to rsyncd OR ssh): ERROR, "execv: No such file or directory"
aeheathc@crucible ~ $ ssh -i /home/aeheathc/.ssh/id_rsa -p 2222 -l backuppc rondel "rsync -a --progress --delete --password-file=/storage/emulated/0/rsync_backup_crucible /storage/emulated/0/ rsync://[email protected]/backup/redundinator/hosts/rondel/paths/_storage_emulated_0"
execv: No such file or directory
aeheathc@crucible ~ $ ssh -i /home/aeheathc/.ssh/id_rsa -p 2222 -l backuppc rondel "rsync -a --progress --delete -e 'ssh -i /data/smbrw_key -p 22' /storage/emulated/0/ [email protected]:/mnt/backup/redundinator/hosts/rondel/paths/_storage_emulated_0"
execv: No such file or directory
- On the server, using a command that opens ssh to the phone and runs a command there to echo text: WORKS
aeheathc@crucible ~ $ ssh -i /home/aeheathc/.ssh/id_rsa -p 2222 -l backuppc rondel "echo blah"
blah
- From what I understand, the error is execv saying it can't find an executable at the path that was passed into it. But what was that path? I'd need to know that to investigate further on my own.
- /var/log/auth.log contains only successful connections, nothing enlightening.
- sudo before any of the commands doesn't seem to help.