-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup_files.dart
More file actions
executable file
·36 lines (34 loc) · 1.15 KB
/
backup_files.dart
File metadata and controls
executable file
·36 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import 'dart:io';
import 'package:create_backup/module.dart';
void main(List<String> arguments) async {
beginNewLogPart();
writeLog('Started backup 💽 🚀');
final constants = await Constants.getInstance();
var backupSuccess = true;
for (final backupLocation in constants.backupLocations) {
backupSuccess =
await move(backupLocation, constants.backupDestination)
&& backupSuccess;
}
writeLog('Files backed up 💽 🏁');
if (backupSuccess) {
final fileSize = await getFullBackupGiBs();
writeLog(
'⏭️ To continue, an encrypted volume needs to be present:\n'
'${newLogLinePadding()}'
'1️⃣ Create an encrypted volume ${constants.dateStamp} with at least '
'${fileSize.toString()} GiB 🔒, e.g., using VeraCrypt\n'
'${newLogLinePadding()}'
'2️⃣ Mount the volume as ${constants.encryptedVolumePath} ⛰️\n'
'${newLogLinePadding()}'
'3️⃣ When you are done, run '
'`bash start.sh encrypt <LOG_PATH>` 📜',
);
} else {
writeLog(
'⛔️ However, errors are present; please fix the errors and try '
'again to continue'
);
}
exit(0);
}