# Chain between multiple recipes

**URL:** <https://discourse.chef.io/t/chain-between-multiple-recipes/13922>\
**Category:** Chef Infra (archive)\
**Created:** [November 1, 2018, 10:13am UTC](https://discourse.chef.io/t/chain-between-multiple-recipes/13922 "2018-11-01T10:13:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![israel](https://avatars.discourse-cdn.com/v4/letter/i/b77776/32.png) [@israel](https://discourse.chef.io/u/israel)\
**Post date:** [November 1, 2018, 10:13am UTC](https://discourse.chef.io/t/chain-between-multiple-recipes/13922/1 "2018-11-01T10:13:36Z")

</div>

Hi,  
Why chef "scan" all the recipes b4, I'll explain.  
I have 3 recipes that chain to each other with include command:  
For example:  
Recipe1:  
directory '/tmp/backup' do  
owner 'root'  
group 'root'  
mode '0755'  
recursive true  
action :create  
end  
include\_recipe ‘cookbook::preparation’  
Recipe2:  
include\_recipe ‘cookbook::restore’  
The problem is that the chef is “scan” all the recipes at one time and failed that he can’t find folder/file in recipe 2.  
Recipe 1 need to create this folder but somehow the chef is jumped to recipe2.  
default recipe:  
include\_recipe 'centos7::git\_clone' # recipe1  
include\_recipe 'centos7::preparation' # recipe2  
include\_recipe 'centos7::restore' # recipe3

I hope I’ve explained myself good.  
Please HELP

![image](https://sea2.discourse-cdn.com/flex016/images/transparent.png)

---

<div class="post-metadata">

**Author:** ![cheeseplus](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/cheeseplus/32/960_2.png) [@cheeseplus](https://discourse.chef.io/u/cheeseplus)\
**Post date:** [November 12, 2018, 4:49pm UTC](https://discourse.chef.io/t/chain-between-multiple-recipes/13922/2 "2018-11-12T16:49:57Z")

</div>

This was answered and resolved in [http://community-slack.chef.io/](http://community-slack.chef.io/)
