Backup and restore tahoelafs to usb

This commit is contained in:
Bob Mottram 2016-08-29 11:04:37 +01:00
parent 3856005b72
commit 0c842943f4
1 changed files with 18 additions and 4 deletions

View File

@ -108,13 +108,27 @@ function upgrade_tahoelafs {
} }
function backup_local_tahoelafs { function backup_local_tahoelafs {
echo -n '' source_directory=/home/tahoelafs/.tahoe-introducer
# TODO if [ ! -d $source_directory ]; then
return
fi
systemctl stop tahoelafs
dest_directory=tahoelafs
function_check backup_directory_to_usb
backup_directory_to_usb $source_directory $dest_directory
echo $"Backup to $dest_directory complete"
systemctl start tahoelafs
} }
function restore_local_tahoelafs { function restore_local_tahoelafs {
echo -n '' echo $"Restoring Tahoe-LAFS introducer"
# TODO systemctl stop tahoelafs
temp_restore_dir=/root/temptahoelafs
restore_directory_from_usb $temp_restore_dir tahoelafs
rm -rf /home/tahoelafs/.tahoe-introducer
cp -r $temp_restore_dir/home/tahoelafs/.tahoe-introducer /home/tahoelafs/
chown -R tahoelafs:tahoelafs /home/tahoelafs
systemctl start tahoelafs
} }
function backup_remote_tahoelafs { function backup_remote_tahoelafs {