# Not able to save cdb backup using confd

**URL:** <https://dmap-community.ductus.global/t/not-able-to-save-cdb-backup-using-confd/756>\
**Category:** CDB and CDB API\
**Created:** [October 5, 2016, 10:52am UTC](https://dmap-community.ductus.global/t/not-able-to-save-cdb-backup-using-confd/756 "2016-10-05T10:52:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kamal\_M](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@Kamal\_M](https://dmap-community.ductus.global/u/Kamal_M)\
**Post date:** [October 5, 2016, 10:52am UTC](https://dmap-community.ductus.global/t/not-able-to-save-cdb-backup-using-confd/756/1 "2016-10-05T10:52:57Z")

</div>

I am not able to apply “confd --cdb-backup” as I can see come error.  
[root@pl-ipfe-1\_3\_0 ~]# /opt/nec/vcpe/lib/confd/erts/bin/confd --cdb-backup /root/filename.tar  
Environment variable BINDIR is not set  
How to solve this ?

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [October 5, 2016, 11:08am UTC](https://dmap-community.ductus.global/t/not-able-to-save-cdb-backup-using-confd/756/2 "2016-10-05T11:08:22Z")

</div>

Is ConfD up and running? Can you run #confd --status? If so, what is your output?  
You use confd --cdb-backup when ConfD is running. If ConfD is not running , you can safely instead just copy the \*.cdb files from your confd-cdb directory.

---

<div class="post-metadata">

**Author:** ![per](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@per](https://dmap-community.ductus.global/u/per)\
**Post date:** [October 5, 2016, 11:29am UTC](https://dmap-community.ductus.global/t/not-able-to-save-cdb-backup-using-confd/756/3 "2016-10-05T11:29:37Z")

</div>

> [@Kamal\_M](#):
>
> I am not able to apply “confd --cdb-backup” as I can see come error.  
> [root@pl-ipfe-1\_3\_0 ~]# /opt/nec/vcpe/lib/confd/erts/bin/confd --cdb-backup /root/filename.tar  
> Environment variable BINDIR is not set  
> How to solve this ?

```
$ source /opt/nec/vcpe/confdrc
$ confd --cdb-backup /root/filename.tar

```

I.e. don’t try to execute some random file called ‘confd’ in your installation, but only the one that is in your $PATH when you have sourced confdrc. (That will be /opt/nec/vcpe/bin/confd in your case, not /opt/nec/vcpe/lib/confd/erts/bin/confd.)

---

<div class="post-metadata">

**Author:** ![Kamal\_M](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@Kamal\_M](https://dmap-community.ductus.global/u/Kamal_M)\
**Post date:** [October 5, 2016, 2:34pm UTC](https://dmap-community.ductus.global/t/not-able-to-save-cdb-backup-using-confd/756/4 "2016-10-05T14:34:36Z")

</div>

Hi Per,

Thank you for your reply, I got tar file (saved.tar).  
If I extract tar file I can see file saved with name “saved” there is no any extension for it.  
My requirement is at a particular point of time if I want my device to run with saved configs(saved.tar) what could be the next step.

---

<div class="post-metadata">

**Author:** ![per](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@per](https://dmap-community.ductus.global/u/per)\
**Post date:** [October 5, 2016, 3:09pm UTC](https://dmap-community.ductus.global/t/not-able-to-save-cdb-backup-using-confd/756/5 "2016-10-05T15:09:05Z")

</div>

> [@Kamal\_M](#):
>
> Thank you for your reply, I got tar file (saved.tar).If I extract tar file I can see file saved with name “saved” there is no any extension for it.

How are you doing the extraction? Per the documentation (confd(1)):

```
   --cdb-backup File
       Save a snapshot of the CDB database into a GZipp:ed tar
       archive file (given by the File argument). 

```

Maybe you will have better luck if you name the file saved.tar.gz.

```
 $ confd --cdb-backup /tmp/saved.tar
 $ tar ztvf /tmp/saved.tar
 -rw-r--r-- 1016/1016 897549 2016-08-31 10:22 C.cdb
 -rw-r--r-- 1016/1016 161 2015-12-15 15:14 A.cdb
 $ confd --cdb-backup /tmp/saved.tar.gz
 $ tar ztvf /tmp/saved.tar.gz 
 -rw-r--r-- 1016/1016 897549 2016-08-31 10:22 C.cdb
 -rw-r--r-- 1016/1016 161 2015-12-15 15:14 A.cdb

```

I.e. the Linux ‘tar’ command doesn’t care how the file is named, but perhaps whatever you are using for the extraction does.

---

<div class="post-metadata">

**Author:** ![Kamal\_M](https://avatars.discourse-cdn.com/v4/letter/k/a88e4f/32.png) [@Kamal\_M](https://dmap-community.ductus.global/u/Kamal_M)\
**Post date:** [October 6, 2016, 7:12am UTC](https://dmap-community.ductus.global/t/not-able-to-save-cdb-backup-using-confd/756/6 "2016-10-06T07:12:52Z")

</div>

Hi Per/Cohult,

I am able to get tar file with A.cdb and C.cdb.  
Thank you.
