Is there a limit to the size of a command you can run under aptible ssh
I’m attempting to run a rake task that takes a large number of arguments (zipcodes)
Is there a limit to the size of a command you can run under aptible ssh
I’m attempting to run a rake task that takes a large number of arguments (zipcodes)
Looks like the command is stored in a database column with 255 character limit. We can probably increase that. In the meantime, you’ll probably have to work around it by pushing the args into a script.
Thanks!
Okay so something like
~bundle exec rake export:tasks["$(cat args_list.txt)","an_arg","another_arg"]
or scripting through the rake task?
Now that I think about it, the shelling out to cat
prob doesn’t work….
I think the best option would be to run aptible ssh
, get a bash prompt, and then run whatever you need to run at that prompt (there won’t be a limit then.)
so you’d run
bundle exec rake lots-of-arguments-that-go-on-forever-and-ever
in the bash session. Shelling out to cat
should work, though, if you’ve populated arg_list.txt
in your working directory.
Problem is that the output is huge and valuable, so I want to capture it on my dev machine (in response to the aptible ssh
approach)
@Philonous…I think I have another option:
just pipe your ssh session to tee
, that’ll give you a dump of everything. for example:
aptible ssh --app myapp | tee /tmp/session-dump.txt
you’ll get an interactive session, plus a record of everything in /tmp/session-dump.txt
when you’re done
What about timeouts? I have a long running script that I need to execute on my application, but there seems to be a timeout associated with aptible ssh
. Is there a way to get around it?
This may actually be controllable client-side.
I don’t think they have a ClientAliveInterval
set on aptible ssh
by default, but I believe that if you add the following to a $HOME/.ssh/config
file on your machine:
TCPKeepAlive yes
ServerAliveInterval 60
it should keep your connection up, short of a loss of your network connection (or IP change, etc.)