# Transfer files and or create a directory as a part of application update

**URL:** <https://hub.mender.io/t/transfer-files-and-or-create-a-directory-as-a-part-of-application-update/2461>\
**Category:** General Discussions\
**Tags:** yocto, raspberry-pi-3, warrior\
**Created:** [September 17, 2020, 5:47pm UTC](https://hub.mender.io/t/transfer-files-and-or-create-a-directory-as-a-part-of-application-update/2461 "2020-09-17T17:47:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [September 17, 2020, 5:47pm UTC](https://hub.mender.io/t/transfer-files-and-or-create-a-directory-as-a-part-of-application-update/2461/1 "2020-09-17T17:47:41Z")

</div>

Hello ,

I trying to check my understanding here. I wanted transfer some files or links and if possible create a directory structure on my persistent data.

I thought the best way to go about it would be doing a application update and using mender directory update module.

One of the users notified me that I had to add modules in yocto configuration. But even after that I am unable to successfully perform an application update.

I think the problem was that I didn’t create a proper application update and in between the update I power cycled the system?

So I have two questions that might help me solve my issue.

1. Is this the right way to achieve this?
2. How do I populate these below mentioned variables

```auto
DEST_DIR="/opt/installed-by-directory/"
FILE_TREE="dir-to-deploy"

```

So DEST\_DIR is where I want to directory to be installed right? So for example if I want to achieve an output like this

–data  
-------mender  
-------uboot  
-------system(New folder structure)

Then

> DEST\_DIR=/data/

is this correct?  
or should it be

> DEST\_DIR=/data/system/

Where system is the new folder I want installed in /data

FILE\_TREE should be the name of my folder created. So in the above example it should be equatl to **system**?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [September 17, 2020, 6:01pm UTC](https://hub.mender.io/t/transfer-files-and-or-create-a-directory-as-a-part-of-application-update/2461/2 "2020-09-17T18:01:27Z")

</div>

As far as I recall it should be `DEST_DIR=/data/system`. Does that not work for you?

---

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [September 17, 2020, 6:05pm UTC](https://hub.mender.io/t/transfer-files-and-or-create-a-directory-as-a-part-of-application-update/2461/3 "2020-09-17T18:05:52Z")

</div>

I had only tried /data I will try it now. That could be where I am going wrong  
I will update you in some time

---

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [September 17, 2020, 9:48pm UTC](https://hub.mender.io/t/transfer-files-and-or-create-a-directory-as-a-part-of-application-update/2461/4 "2020-09-17T21:48:37Z")

</div>

That worked

---

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [September 17, 2020, 9:54pm UTC](https://hub.mender.io/t/transfer-files-and-or-create-a-directory-as-a-part-of-application-update/2461/5 "2020-09-17T21:54:32Z")

</div>

Is there a way to send a soft link file as an application update?

Edit 1  
The reason I am asking this is because. I wanted to test an application update that does the following.

1. Create a folder structure
2. Transfer a .conf file
3. Transfer a symlink file
4. Transfer a text file

I was able to create a folder structure. I transferred a .conf file used by timesyncd and a symlink file used by timedatectl

the conf file worked okay. I was able to restart systemd-timesyncd and saw the status changing.

1. The only issue I had, was in transferring a symlink file. How do I transfer a symlink file in application update

2. how do I change the owner of the files involved in application update to root. I see that now the owner of the group is basically the user who creates the update?  
Is there a way to specify who the owner should be while creating an application update?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [September 18, 2020, 1:44pm UTC](https://hub.mender.io/t/transfer-files-and-or-create-a-directory-as-a-part-of-application-update/2461/6 "2020-09-18T13:44:17Z")

</div>

Not in the current update modules. I suspect these changes are best implemented as a state script since it is likely going to be very custom and any attempt to make it generic will not likely work for many use cases.

The alternative would be to use a script type update module but I think the state script approach is simpler.

---

<div class="post-metadata">

**Author:** ![thesillywhat](https://avatars.discourse-cdn.com/v4/letter/t/57b2e6/32.png) [@thesillywhat](https://hub.mender.io/u/thesillywhat)\
**Post date:** [September 18, 2020, 4:08pm UTC](https://hub.mender.io/t/transfer-files-and-or-create-a-directory-as-a-part-of-application-update/2461/7 "2020-09-18T16:08:36Z")

</div>

Edit 3 I will add my question to an existing discussion
