简体   繁体   English

如何下载文件并压缩文件?

[英]How to download a file and zip the file?

How do I get a URL to download a backup from Heroku, fetch the file via curl, and zip the new file?如何获取 URL 以从 Heroku 下载备份、通过 curl 获取文件并压缩新文件?

Heroku deliveries the url. Heroku 提供 url。

heroku pg:backups:url --app example-app | cat

I'm wondering if I can then curl the output of the backup into a zip file.我想知道我是否可以将备份的输出卷曲到一个 zip 文件中。

  1. get backup file URL获取备份文件 URL
  2. download file from URL从 URL 下载文件
  3. zip of file压缩文件

I'm getting lost on how to redirect the output of each command to fit this together.我迷失了如何重定向每个命令的输出以将其组合在一起。

heroku 客户端也有一个用于下载转储的标志

heroku pg:backups:download --app example-app && gzip latest.dump

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM