Browse Source

Backup and restore tahoelafs to usb

Bob Mottram 8 years ago
parent
commit
0c842943f4
1 changed files with 18 additions and 4 deletions
  1. 18
    4
      src/freedombone-app-tahoelafs

+ 18
- 4
src/freedombone-app-tahoelafs View File

108
 }
108
 }
109
 
109
 
110
 function backup_local_tahoelafs {
110
 function backup_local_tahoelafs {
111
-    echo -n ''
112
-    # TODO
111
+    source_directory=/home/tahoelafs/.tahoe-introducer
112
+    if [ ! -d $source_directory ]; then
113
+        return
114
+    fi
115
+    systemctl stop tahoelafs
116
+    dest_directory=tahoelafs
117
+    function_check backup_directory_to_usb
118
+    backup_directory_to_usb $source_directory $dest_directory
119
+    echo $"Backup to $dest_directory complete"
120
+    systemctl start tahoelafs
113
 }
121
 }
114
 
122
 
115
 function restore_local_tahoelafs {
123
 function restore_local_tahoelafs {
116
-    echo -n ''
117
-    # TODO
124
+    echo $"Restoring Tahoe-LAFS introducer"
125
+    systemctl stop tahoelafs
126
+    temp_restore_dir=/root/temptahoelafs
127
+    restore_directory_from_usb $temp_restore_dir tahoelafs
128
+    rm -rf /home/tahoelafs/.tahoe-introducer
129
+    cp -r $temp_restore_dir/home/tahoelafs/.tahoe-introducer /home/tahoelafs/
130
+    chown -R tahoelafs:tahoelafs /home/tahoelafs
131
+    systemctl start tahoelafs
118
 }
132
 }
119
 
133
 
120
 function backup_remote_tahoelafs {
134
 function backup_remote_tahoelafs {