Local backup for ipfs

This commit is contained in:
Bob Mottram 2016-07-07 11:56:21 +01:00
parent 7afd0e27a4
commit a17c56f243
No known key found for this signature in database
GPG Key ID: BA68F26108DC9F87
1 changed files with 15 additions and 2 deletions

View File

@ -47,11 +47,24 @@ function upgrade_ipfs {
} }
function backup_local_ipfs { function backup_local_ipfs {
echo '' if ! grep -q "Admin user" $COMPLETION_FILE; then
return
fi
ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}')
source_directory=/home/$ADMIN_USERNAME/.ipfs
if [ -d $source_directory ]; then
dest_directory=ipfs
echo $"Backing up $source_directory to $dest_directory"
function_check backup_directory_to_usb
backup_directory_to_usb $source_directory $dest_directory
echo $"Backup to $dest_directory complete"
fi
} }
function backup_remote_ipfs { function backup_remote_ipfs {
echo '' echo -n ''
} }
function remove_ipfs { function remove_ipfs {