i cannot get the following running thru the pipe, its working on the target's cli though:
- ssh $HOST find $SOMEDIR -exec mv {} $OTHER_DIR \;
it complains about 'missing an argument to -exec'
tried every imaginable quoting - no idea anymore - do you?
Hello @Jan Hüffelmann,
Well, this wouldn't work on any box, not just Pipelines:
❯ ssh test@tower find . -name ".*profile" -exec file {} \;
find: missing argument to `-exec'
A complex command has to be quoted when passed to ssh. This works fine:
❯ ssh test@tower 'find . -name ".*profile" -exec file {} \;'
./.bash_profile: ASCII text
Hope this helps.
Cheers,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So here's an exact command that works for me:
pipelines:
default:
- step:
script:
- ssh -p 10080 -l www -oStrictHostKeyChecking=no 0.tcp.au.ngrok.io 'find . -name ".*history" -exec cat {} \;'
Here's a screenshot of a successful pipeline for that config (last line ls -la is the content of .ash_history file located on the remote server ssh connects to):
I was testing against a locally running Docker image panubo/sshd, which is based on Alpine Linux, through ngrok — hence such target hostname in the config.
So I'm wondering maybe the issue you're facing is with the target host? Otherwise please double check the actual ssh command you're calling.
Please let me know if this helps.
Cheers,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry, must be ive messed someting up testing back and forth, now its working single quoted as you mentioned, ty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.