Not able to save cdb backup using confd

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 ?

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.

$ 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.)

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.

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.

Hi Per/Cohult,

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