Closed jcr7301 closed 2 years ago
@jcr7301 Hm, not sure. If you can share your python code that would be helpful.
Also try adding the --cache
option. This will stop axiom from regenerating the SSH config every time. To only generate the SSH config run axiom-ssh --just-generate
@jcr7301 You might want to copy the sshconfig file to a tmp directory, then run axiom-scp with the -F
flag pointing to the tmp SSH config file. This will prevent another thread from potentially overwriting the config. Thats how we do it with axiom-scan for every axiom-scp we execute.
https://github.com/pry0cc/axiom/blob/master/interact/axiom-scan#L336 https://github.com/pry0cc/axiom/blob/master/interact/axiom-scan#L558-L559
It's working just with the --cache option in this scenario as I'm using axiom-scp before outside of the threading. Thanks!
Doing axiom-scp with -F option fails in every way I've tried.
axiom-scp ~/xxxx/xxxx.txt 'test01':/home/op/lists/xxxx.txt -F /tmp/.sshconfig
Unexpected remote arg: xxxx01:/home/op/lists/xxxx.txt
rsync error: syntax or usage error (code 1) at main.c(1499) [sender=3.2.3]
axiom-scp -F /tmp/.sshconfig ~/xxxx/xxxx.txt 'test01':/home/op/lists/xxxx.txt
sending incremental file list
created directory /home/op/lists/xxxx.txt
//Creates directory with the file inside instead of sending the file
axiom-scp -F /tmp/.sshconfig "~/xxxx/xxxx.txt 'test01':/home/op/lists/xxxx.txt"
//Sends .sshconfig file content instead of sending the actual file
axiom-scp "~/xxxx/xxxx.txt 'test01':/home/op/lists/xxxx.txt" -F /tmp/.sshconfig
Unexpected remote arg: test01:/home/op/lists/xxxx.txt
rsync error: syntax or usage error (code 1) at main.c(1499) [sender=3.2.3]
@jcr7301 Sorry, try -F=
. I'll see if i can fix that.
Example:
axiom-scp "~/xxxx/xxxx.txt 'test01':/home/op/lists/xxxx.txt" -F=/tmp/.sshconfig
https://github.com/pry0cc/axiom/blob/master/interact/axiom-scp#L45
This solution works fine. Thanks again.
I'm currently getting the following errors when trying to execute multiple axiom-scp (with -v, for debugging reasons) from a python thread:
Same command is working fine in the terminal. I've also saw some error related with
/home/xxxx/.axiom/.sshconfig
and/home/xxxx/.axiom/.sshconfig.new
(I think, I haven't been able to reproduce), but basically when I execute from terminal sshconfig file is filled with all my instances but when I run from python it gets removed and there're maybe 2 instances left.