If you ever want to copy a local file to a remote heroku dyno, you can! Steps:
- Execute heroku ps:exec with the --ssh arg to connect to a dyno of your choice (and reveal the native ssh connection parameters). For example heroku ps:exec --app=my-app --dyno=web.1 --ssh
- Find the ssh command that was used using ps. For example ps ax | grep ssh | grep heroku-exec-key
- Pipe your file right into that ssh command, receive it with cat on the other end and redirect it wherever you want. For example: cat myawesomefile | ssh -o UserKnownHostsFile=/var/folders/fs/v_kjxw8s1nl1lcd9lm_r1vs80000gq/T/heroku-exec-proxy-key2024825-1652-7r5vmz.q7vch -o ServerAliveInterval=10 -o ServerAliveCountMax=3 -p 80 -i /var/folders/fs/v_kjxw8s1nl1lcd9lm_r1vs80000gq/T/heroku-exec-key2024825-1652-4trc3k.akeov [email protected] "cat > /tmp/myawesomefile"