Copy between two local folders also checks for the existence of a private key
Opened this issue · 7 comments
Is it possible to sync between local folders ?
For example, /storage/emulated/0/Pictures/Screenshots
and /storage/sdcard1/Pictures/Screenshots/
?
I tried that..but it is giving error. Though I can't see that. Flashing variable on %stdout, %stderr doesn't work.
Android 5.1
Yes, all being well that should be possible (one of the integration tests is performing a local copy). It would be worthwhile figuring out how to view the returned error so you aren't flying blind.
One thing you might be hitting (that springs to mind) and is on my list of improvements is that Rsync for Tasker requires you to have generated a private key before attempting a local copy (even though it isn't actually needed), so that would be worth trying.
Let me know how you get on.
@ribbons Yes. Thanks. It worked after generating public key.
I deleted the generate key step after that. Tasker steps only have
- Get public key
- Rsync
- Flash %stdout %stderr %pubkey
But where is this pubkey located ? Can I use my own private/pubkey pair (generated from laptop) ?
Glad that did the trick. You don't need to run the 'Get Public Key' action if you're only running against local folders, generating a private key (once) is just a workaround for the current slightly over-zealous key existence check.
The 'Get Public Key' action returns the public key so you can copy it to an SSH host. It is not intended for the private key to be easily accessible (or be easily overwritten by a key generated elsewhere) for security reasons.
I'll go ahead and rename this issue to reflect the original cause of the problem you hit.
It tried to used this public key but it is not working.
- I copied etc/ssh/ssh_host_ecdsa_key.pub from my server to known host field
- Copied the public key to authorized_keys of my server which is openssh server running Ubuntu 20.04
- However sync is hanging and getting time_out.
- I also tried using my own openssh private key with dbclient arguments section
"-i /storage/emulated/0/id_ed25519"
but those are not working either. Getting string is too long error
which is probably due to incompatibility between openssh and dropbear ?
- Atm Local sync working but unble to sync to a localhost.
Okay, glad local sync is working for you. If you're having trouble running sync to a remote host that's quite a different issue to what you first described. I'd recommend checking out the troubleshooting steps I covered in #118 and if you're still having trouble connecting once you've followed those, open a new issue and include the verbose output from the dbclient action.
@ribbons Thanks. That worked! The trick was to use ed25519 key with ssh-keyscan -t ed25519 <host.ip>
as mentioned in #118 (Which is different than what I have in /etc/ssh/)/. Rsync is now also working.
Though I am getting this warning : ignoring unknows option -4, even though I didn't use such option. I think it is used for ipv4 ? But that's seeperate issue.
@ribbons Thanks. That worked! The trick was to use ed25519 key with
ssh-keyscan -t ed25519 <host.ip>
as mentioned in #118 (Which is different than what I have in /etc/ssh/)/. Rsync is now also working.
Excellent 👍
Though I am getting this warning : ignoring unknows option -4, even though I didn't use such option. I think it is used for ipv4 ? But that's seeperate issue.
I think that message is caused by rsync passing an option to dbclient that it doesn't understand (so the warning can be ignored in this instance).