Bitcoin Forum
April 26, 2024, 01:40:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Backing Up My Wallet  (Read 1721 times)
kiba (OP)
Legendary
*
Offline Offline

Activity: 980
Merit: 1014


View Profile
January 24, 2011, 04:50:24 AM
 #1

My saving is continuing to grow! So I sought a backup solution in case something bad happens.

Code:
#!/bin/bash
 
 TS=$(date "+%Y%m%d-%H-%M")
 
 WALLET=/tmp/wallet${TS}
 WALLET_E=/tmp/wallet${TS}.crypt
 
 bitcoind backupwallet $WALLET
 gpg -r myusername --output $WALLET_E --encrypt $WALLET
 scp $WALLET_E user@myserver.org:~/wallets/
 rm $WALLET $WALLET_E

I am using this script from the https://en.bitcoin.it/wiki/Securing_your_wallet#Linux_solution

But I am running into problems:
Code:
usage: gpg [options] [filename]
/tmp/wallet20110124-04-46.crypt: No such file or directory
rm: cannot remove `/tmp/wallet20110124-04-46.crypt': No such file or directory

1714138848
Hero Member
*
Offline Offline

Posts: 1714138848

View Profile Personal Message (Offline)

Ignore
1714138848
Reply with quote  #2

1714138848
Report to moderator
1714138848
Hero Member
*
Offline Offline

Posts: 1714138848

View Profile Personal Message (Offline)

Ignore
1714138848
Reply with quote  #2

1714138848
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714138848
Hero Member
*
Offline Offline

Posts: 1714138848

View Profile Personal Message (Offline)

Ignore
1714138848
Reply with quote  #2

1714138848
Report to moderator
1714138848
Hero Member
*
Offline Offline

Posts: 1714138848

View Profile Personal Message (Offline)

Ignore
1714138848
Reply with quote  #2

1714138848
Report to moderator
1714138848
Hero Member
*
Offline Offline

Posts: 1714138848

View Profile Personal Message (Offline)

Ignore
1714138848
Reply with quote  #2

1714138848
Report to moderator
grondilu
Legendary
*
Offline Offline

Activity: 1288
Merit: 1076


View Profile
January 24, 2011, 05:11:23 AM
Last edit: January 24, 2011, 05:26:40 AM by grondilu
 #2

/tmp/wallet20110124-04-46.crypt: No such file or directory

For some reason the file could not be encrypted.

Has the file /tmp/wallet20110124-04-46 been created by bitcoind backupwallet ?
I suspect backupwallet doesn't accept full pathnames

PS:  Here is a proposal to make the script more robust :
Code:
#!/bin/bash

TS=$(date "+%Y%m%d-%H-%M")
WALLET=/tmp/wallet${TS}
WALLET_E=/tmp/wallet${TS}.crypt

if
    echo -n making backup...
    bitcoind backupwallet $WALLET
    [[ ! -s "$WALLET" ]]
then echo failed
elif
    echo done
    echo -n encrypting....
    ! gpg -r myusername --output $WALLET_E --encrypt $WALLET
then echo failed
elif
    echo done
    echo -n copying to distant server...
    ! scp $WALLET_E user@myserver.org:~/wallets/
then echo failed
else echo done
fi

rm -f $WALLET $WALLET_E

kiba (OP)
Legendary
*
Offline Offline

Activity: 980
Merit: 1014


View Profile
January 26, 2011, 04:12:31 PM
 #3

Code:
making backup...done
encrypting....usage: gpg [options] [filename]
failed


I believe it fails in the encryption stage.

grondilu
Legendary
*
Offline Offline

Activity: 1288
Merit: 1076


View Profile
January 26, 2011, 04:39:16 PM
 #4

Code:
making backup...done
encrypting....usage: gpg [options] [filename]
failed


I believe it fails in the encryption stage.

Does it work if you try to encrypt the file yourself from the command line ?

This should be easy to debug, just try different things.

kiba (OP)
Legendary
*
Offline Offline

Activity: 980
Merit: 1014


View Profile
January 26, 2011, 05:11:22 PM
 #5

Success. I didn't know that I was supposed to use my email address rather than my name.
* kiba is unfamiliar with cryptographic tool like GPG in general.

kiba (OP)
Legendary
*
Offline Offline

Activity: 980
Merit: 1014


View Profile
January 30, 2011, 04:29:22 PM
 #6

I pasted grondilu's improvement back into the wiki.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!