如何从 Heroku bash 下载文件? [英] How can I download a file from Heroku bash?

查看:30
本文介绍了如何从 Heroku bash 下载文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 Heroku bash 运行了一个 ruby​​ 脚本,它在我想下载的服务器上生成一个 CSV 文件.我尝试将其移动到公共文件夹进行下载,但没有奏效.我发现在 Heroku bash 控制台中的每个会话之后,文件都会删除.有没有直接从 Heroku bash 控制台下载的命令?

I ran a ruby script from Heroku bash that generates a CSV file on the server that I want to download. I tried moving it to the public folder to download, but that didn't work. I figured out that after every session in the Heroku bash console, the files delete. Is there a command to download directly from the Heroku bash console?

推荐答案

Heroku dyno 文件系统是短暂的, 非持久性且不在 dynos 之间共享.因此,当您执行 heroku run bash 时,您实际上会获得一个新的 dyno,并重新部署了您的应用程序,而无需对其他 dyno 中的临时文件系统进行任何更改.

Heroku dyno filesystems are ephemeral, non-persistant and not shared between dynos. So when you do heroku run bash, you actually get a new dyno with a fresh deployment of you app without any of the changes made to ephemeral filesystems in other dynos.

如果你想做这样的事情,你应该要么在 heroku run bash 会话中完成,要么在 Heroku 上运行的 Web 应用程序的请求中完成,该应用程序以 CSV 文件响应你想要.

If you want to do something like this, you should probably either do it all in a heroku run bash session or all in a request to a web app running on Heroku that responds with the CSV file you want.

这篇关于如何从 Heroku bash 下载文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆