# Remote directory creation question

**URL:** <https://discourse.chef.io/t/remote-directory-creation-question/2090>\
**Category:** Chef Infra (archive)\
**Created:** [October 11, 2011, 9:16pm UTC](https://discourse.chef.io/t/remote-directory-creation-question/2090 "2011-10-11T21:16:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maven\_User](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@Maven\_User](https://discourse.chef.io/u/Maven_User)\
**Post date:** [October 11, 2011, 9:16pm UTC](https://discourse.chef.io/t/remote-directory-creation-question/2090/1 "2011-10-11T21:16:06Z")

</div>

I have a quick question about directories/remote directory syntax.

If I have a set of directories I’d like to create, BUT on the system, they  
may be filled with things, I’d like to back them up prior to creating the  
new, empty ones.

I see that remote\_directory offers this backup feature and I like being able  
to sketch out my folder structure in files/default/foo/bar.

When I do this though:

```
remote_directory "C:/foo/bar" do
  source "foo/bar"
  files_backup 10
end

```

and the directory within the cookbook files/default/foo/bar is empty,  
nothing is created.

Do I _have_ to have files in there in order for the directories to be  
created?

---

<div class="post-metadata">

**Author:** ![Vladimir\_Girnet](https://avatars.discourse-cdn.com/v4/letter/v/e19b73/32.png) [@Vladimir\_Girnet](https://discourse.chef.io/u/Vladimir_Girnet)\
**Post date:** [October 12, 2011, 6:54am UTC](https://discourse.chef.io/t/remote-directory-creation-question/2090/2 "2011-10-12T06:54:43Z")

</div>

Use "directory" resource to create directories  
"remote\_directory" is for transferring recursively files/directories  
from cookbooks

On 10/12/11 12:16 AM, Maven User wrote:

> I have a quick question about directories/remote directory syntax.
> 
> If I have a set of directories I'd like to create, BUT on the system,  
> they may be filled with things, I'd like to back them up prior to  
> creating the new, empty ones.
> 
> I see that remote\_directory offers this backup feature and I like  
> being able to sketch out my folder structure in files/default/foo/bar.
> 
> When I do this though:
> 
> ```
> remote_directory "C:/foo/bar" do
> source "foo/bar"
> files_backup 10
> end
> 
> ```
> 
> and the directory within the cookbook files/default/foo/bar is empty,  
> nothing is created.
> 
> Do I _have_ to have files in there in order for the directories to be  
> created?

--  
Vladimir Girnet  
Infrastructure Engineer  
Tacit Knowledge

> **[Tacit Knowledge joins forces with Grid Dynamics - Tacit Knowledge](http://www.tacitknowledge.com)**
>
> In May 2021, we joined forces with Grid Dynamics, a digital-native technology services provider that accelerates growth for Forture 1000 companies.

---

<div class="post-metadata">

**Author:** ![Maven\_User](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@Maven\_User](https://discourse.chef.io/u/Maven_User)\
**Post date:** [October 14, 2011, 4:05pm UTC](https://discourse.chef.io/t/remote-directory-creation-question/2090/3 "2011-10-14T16:05:53Z")

</div>

The remote\_directory doesn't work if it's just empty directories (you need  
at least one file in there).

Or am I missing something?

On Wed, Oct 12, 2011 at 2:54 AM, Vladimir Girnet \<[vgirnet@tacitknowledge.com](mailto:vgirnet@tacitknowledge.com)

> wrote:

> Use "directory" resource to create directories  
> "remote\_directory" is for transferring recursively files/directories  
> from cookbooks
> 
> On 10/12/11 12:16 AM, Maven User wrote:
> 
> > I have a quick question about directories/remote directory syntax.
> > 
> > If I have a set of directories I'd like to create, BUT on the system,  
> > they may be filled with things, I'd like to back them up prior to  
> > creating the new, empty ones.
> > 
> > I see that remote\_directory offers this backup feature and I like  
> > being able to sketch out my folder structure in files/default/foo/bar.
> > 
> > When I do this though:
> > 
> > ```
> > remote_directory "C:/foo/bar" do
> > source "foo/bar"
> > files_backup 10
> > end
> > 
> > ```
> > 
> > and the directory within the cookbook files/default/foo/bar is empty,  
> > nothing is created.
> > 
> > Do I _have_ to have files in there in order for the directories to be  
> > created?
> 
> --  
> Vladimir Girnet  
> Infrastructure Engineer  
> Tacit Knowledge  
> [http://www.tacitknowledge.com](http://www.tacitknowledge.com)
