Etcd back up and restore v1.20.2

Hi I am performing etcd backup and restore.

I followed these steps

to backup

ETCDCTL_API=3 etcdctl snapshot save /home/cloud_user/etcd_backup.db \
  --endpoints=https://localhost:2379 \
  --cacert=/home/cloud_user/etcd-certs/etcd-ca.pem \
  --cert=/home/cloud_user/etcd-certs/etcd-server.crt \
  --key=/home/cloud_user/etcd-certs/etcd-server.key

to stop etcd

sudo systemctl stop etcd

remove current content

sudo rm -rf /var/lib/etcd

to restore

sudo ETCDCTL_API=3 etcdctl snapshot restore /home/cloud_user/etcd_backup.db \
  --initial-cluster etcd-restore=https://localhost:2380 \
  --initial-advertise-peer-urls https://localhost:2380 \
  --name etcd-restore \
  --data-dir /var/lib/etcd

sudo chown -R etcd:etcd /var/lib/etcd
sudo systemctl start etcd

am not sure why it is not working please guide me.

this is the result

ETCDCTL_API=3 etcdctl snapshot save /home/cloud_user/etcd_backup.db   --endpoints=https://localhost:2379   --cacert=/home/cloud_user/etcd-certs/etcd-ca.pem   --cert=/home/cloud_user/etcd-certs/etcd-server.crt   --key=/home/cloud_user/etcd-certs/etcd-server.key
{"level":"info","ts":1612819576.3695357,"caller":"snapshot/v3_snapshot.go:119","msg":"created temporary db file","path":"/home/cloud_user/etcd_backup.db.part"}

Hello,
You have to put the correct name of your endpoint on the this line "–endpoints=https://localhost:2379 " and not localhost. It should be working !