Permission denied when attempting to backup wallet using backupwallet When I call bitcoin@raspberrypi:~ $ bitcoin-cli backupwallet &quot;backup.dat&quot;, I get the following error:
error code: -4
error message:
Error: Wallet backup failed!
~/.bitcoin/debug.log shows the following:

error copying wallet.dat to backup.dat - boost::filesystem::copy_file: Permission denied: &quot;/home/bitcoin/.bitcoin/new_wallet/wallet.dat&quot;, &quot;backup.dat&quot;

Is it something I'm doing wrong?  Do I need to give permissions to user &quot;bitcoin&quot;?
The wallet is not encrypted.
Thanks
You need to check ownership and permissions for the files and folders involved. Your current user needs permissions to read /home/bitcoin/.bitcoin/new_wallet/wallet.dat and permissions to write to the current directory for backup.dat
Try ls -ld /home/bitcoin/.bitcoin/new_wallet/wallet.dat . and pwd and id. The permissions will be shown as three triplets for owner, group and others shown as rwxr-x--- 1 bitcoin pi which means the owner (user &quot;bitcoin&quot;) has read, write and execute permissions (rwx), members of the group (&quot;pi&quot;) have only read and execute permission (r-x) and other people have no permissions at all (---). The id command will tell you which groups your current use is a member of. The pwd will tell you the full name of the current directory where you are trying to write your backup.dat

To further diagnose the problem try
see if the target already exists and can't be overwritten
ls -l backup.dat
mv backup.dat backup.dat.old
echo test &gt; backup.dat

see if the source file is readable - look for messages no read permission
file /home/bitcoin/.bitcoin/new_wallet/wallet.dat

try to copy it directly
cp /home/bitcoin/.bitcoin/new_wallet/wallet.dat backup.dat