# Hab file command

**URL:** <https://discourse.chef.io/t/hab-file-command/19145>\
**Category:** Habitat Help\
**Created:** [June 21, 2018, 2:37pm UTC](https://discourse.chef.io/t/hab-file-command/19145 "2018-06-21T14:37:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![skylerto](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/skylerto/32/2949_2.png) [@skylerto](https://discourse.chef.io/u/skylerto)\
**Post date:** [June 21, 2018, 2:37pm UTC](https://discourse.chef.io/t/hab-file-command/19145/1 "2018-06-21T14:37:03Z")

</div>

Hey y’all, I feel like I must be missing something. The description of the command `hab file upload` says:

> Uploads a file to be shared between members of a Service Group

I'm a little unclear as to what kind of files these should be.

I feel as though this is probably a toml config file, if so, is there any difference between `hab config apply`?

---

<div class="post-metadata">

**Author:** ![smacfarlane](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@smacfarlane](https://discourse.chef.io/u/smacfarlane)\
**Post date:** [June 21, 2018, 2:39pm UTC](https://discourse.chef.io/t/hab-file-command/19145/2 "2018-06-21T14:39:22Z")

</div>

These can be any files your service needs to operate (secrets, ssl certs, etc.) There is a 4k ( I think ) file size limit in place currently so it’s not appropriate for larger items.

---

<div class="post-metadata">

**Author:** ![skylerto](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/skylerto/32/2949_2.png) [@skylerto](https://discourse.chef.io/u/skylerto)\
**Post date:** [June 21, 2018, 2:41pm UTC](https://discourse.chef.io/t/hab-file-command/19145/3 "2018-06-21T14:41:07Z")

</div>

that makes sense thank you!

With that in mind, is there an opposite operation for getting those files from the supervisor?

---

<div class="post-metadata">

**Author:** ![elliott-davis](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/elliott-davis/32/2146_2.png) [@elliott-davis](https://discourse.chef.io/u/elliott-davis)\
**Post date:** [June 21, 2018, 2:42pm UTC](https://discourse.chef.io/t/hab-file-command/19145/4 "2018-06-21T14:42:02Z")

</div>

No, the supervisor will always drop them off in `/hab/svc/<your_svc>/files` but you can’t ask the supervisor for them

---

<div class="post-metadata">

**Author:** ![skylerto](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/skylerto/32/2949_2.png) [@skylerto](https://discourse.chef.io/u/skylerto)\
**Post date:** [June 21, 2018, 2:44pm UTC](https://discourse.chef.io/t/hab-file-command/19145/5 "2018-06-21T14:44:36Z")

</div>

whoa, that hurt my head a little, but I love it!

Thanks @smacfarlane and @elliott-davis!

---

<div class="post-metadata">

**Author:** ![skylerto](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/skylerto/32/2949_2.png) [@skylerto](https://discourse.chef.io/u/skylerto)\
**Post date:** [June 21, 2018, 4:27pm UTC](https://discourse.chef.io/t/hab-file-command/19145/6 "2018-06-21T16:27:21Z")

</div>

@elliott-davis do I need to start my supervisor in a certain way?

I’m running this hab file upload from a hook within habitat.

The command hangs when I try to upload a small file.

```auto
[root@c1f10009fd99 ~]# RUST_LOG=debug hab file upload vault.default $(date +%s) /hab/svc/vault/files/vault.init
DEBUG 2018-06-21T16:25:58Z: habitat_common::ui: UI { shell: Shell { input: InputStream { isatty: true }, out: OutputStream { coloring: Auto, isatty: true, is_colored(): true, supports_color(): true }, err: OutputStream { coloring: Auto, isatty: true, is_colored(): true, supports_color(): true } } }
DEBUG 2018-06-21T16:25:58Z: hab: clap cli args: ["hab", "file", "upload", "vault.default", "1529598358", "/hab/svc/vault/files/vault.init"]
DEBUG 2018-06-21T16:25:58Z: hab: remaining cli args: []
DEBUG 2018-06-21T16:25:58Z: hab::config: No CLI config found, loading defaults
» Uploading file /hab/svc/vault/files/vault.init to 1529598358 incarnation vault.default
Ω Creating service file
DEBUG 2018-06-21T16:25:58Z: tokio::reactor: scheduling direction for: 0
DEBUG 2018-06-21T16:25:58Z: tokio::reactor: loop process - 1 events, 0.000s
DEBUG 2018-06-21T16:25:58Z: tokio::reactor: scheduling direction for: 0
DEBUG 2018-06-21T16:25:58Z: tokio::reactor: loop process - 1 events, 0.000s
↑ Applying via peer 127.0.0.1:9632
DEBUG 2018-06-21T16:25:58Z: tokio::reactor: scheduling direction for: 0

```

---

<div class="post-metadata">

**Author:** ![eeyun1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/eeyun1/32/2658_2.png) [@eeyun1](https://discourse.chef.io/u/eeyun1)\
**Post date:** [June 21, 2018, 9:13pm UTC](https://discourse.chef.io/t/hab-file-command/19145/7 "2018-06-21T21:13:59Z")

</div>

There shouldn’t be any kind of special startup for this to work. Would you mind posting an issue on habitat-sh/habitat ? That is assuming @elliott-davis doesn’t know something I don’t which is entirely possible.

---

<div class="post-metadata">

**Author:** ![elliott-davis](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/elliott-davis/32/2146_2.png) [@elliott-davis](https://discourse.chef.io/u/elliott-davis)\
**Post date:** [June 21, 2018, 9:39pm UTC](https://discourse.chef.io/t/hab-file-command/19145/8 "2018-06-21T21:39:39Z")

</div>

I think an issue is the right thing here assume the file is under 4k

---

<div class="post-metadata">

**Author:** ![skylerto](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/skylerto/32/2949_2.png) [@skylerto](https://discourse.chef.io/u/skylerto)\
**Post date:** [June 21, 2018, 10:42pm UTC](https://discourse.chef.io/t/hab-file-command/19145/9 "2018-06-21T22:42:43Z")

</div>

I’m able to run this as part of the run hook, just not as part of the post-run hook. So I’ve found a work around to the problem. 🙂
