Mercurial > backup
changeset 24:75db8d48c313
rename.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 29 Jan 2015 20:48:32 -0800 |
parents | 9fd4948b4303 |
children | a3e87a2741d4 |
files | backup-luks-headers.pl cd-burn.pl cd-crypt-burn.pl cd-simple-burn.pl luks-headers-backup.pl |
diffstat | 5 files changed, 53 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/backup-luks-headers.pl Thu Jan 29 20:48:32 2015 -0800 1.3 @@ -0,0 +1,19 @@ 1.4 +#!/bin/perl 1.5 + 1.6 + 1.7 + 1.8 +sub backup { 1.9 + my $uuid = shift; 1.10 + my @command = 1.11 + ("cryptsetup", "luksHeaderBackup", "--header-backup-file", 1.12 + "./$uuid.luksHeader", "/dev/disk/by-uuid/$uuid"); 1.13 + print("@command\n"); 1.14 + system(@command); 1.15 +} 1.16 + 1.17 +# TODO -- find all luks drives and do this automatically. 1.18 + 1.19 +&backup("fd14a1d5-ece0-43c4-a3c5-eb93af261cb5"); 1.20 +&backup("23d75d33-611b-424b-810a-099aef0bdd57"); 1.21 +&backup("8543575b-25cc-4132-88ef-39af98f646ae"); 1.22 +&backup("da9b2d38-bb64-459f-b1c8-480b790a2a50");
2.1 --- a/cd-burn.pl Thu Jan 29 20:47:48 2015 -0800 2.2 +++ b/cd-burn.pl Thu Jan 29 20:48:32 2015 -0800 2.3 @@ -23,10 +23,7 @@ 2.4 @burn_command = ("cdrecord", "gracetime=3", "-v", 2.5 "tsize=".$size."s", "-data", "-"); 2.6 2.7 -@aes_loop_command = ("aespipe", "-P", "/etc/cd-key", "-e", "aes256"); 2.8 - 2.9 - 2.10 -$final_command = "mkisofs @mkisofs_args | @aes_loop_command | @burn_command"; 2.11 +$final_command = "mkisofs @mkisofs_args | @burn_command"; 2.12 2.13 print "$final_command\n"; 2.14 system($final_command);
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/cd-crypt-burn.pl Thu Jan 29 20:48:32 2015 -0800 3.3 @@ -0,0 +1,33 @@ 3.4 +#!/bin/perl 3.5 + 3.6 +use File::Basename; 3.7 + 3.8 +$tmp_iso="/home/r/tmp/image.iso"; 3.9 + 3.10 +@graft_points = ("-graft-points"); 3.11 + 3.12 +for $graft_point(@ARGV){ 3.13 + push(@graft_points, '"'. basename($graft_point) .'"' . "=" 3.14 + . '"'. $graft_point . '"'); 3.15 +} 3.16 + 3.17 +@mkisofs_args = ("-iso-level", "4", "-r", "-quiet"); 3.18 + 3.19 +@mkisofs_args = (@mkisofs_args, @graft_points); 3.20 + 3.21 + 3.22 +# get size of stuff 3.23 +$size = `mkisofs -print-size @mkisofs_args 2>/dev/null`; 3.24 +chomp($size); 3.25 + 3.26 +@burn_command = ("cdrecord", "gracetime=3", "-v", 3.27 + "tsize=".$size."s", "-data", "-"); 3.28 + 3.29 +@aes_loop_command = ("aespipe", "-P", "/etc/cd-key", "-e", "aes256"); 3.30 + 3.31 + 3.32 +$final_command = "mkisofs @mkisofs_args | @aes_loop_command | @burn_command"; 3.33 + 3.34 +print "$final_command\n"; 3.35 +system($final_command); 3.36 +
4.1 --- a/cd-simple-burn.pl Thu Jan 29 20:47:48 2015 -0800 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,30 +0,0 @@ 4.4 -#!/bin/perl 4.5 - 4.6 -use File::Basename; 4.7 - 4.8 -$tmp_iso="/home/r/tmp/image.iso"; 4.9 - 4.10 -@graft_points = ("-graft-points"); 4.11 - 4.12 -for $graft_point(@ARGV){ 4.13 - push(@graft_points, '"'. basename($graft_point) .'"' . "=" 4.14 - . '"'. $graft_point . '"'); 4.15 -} 4.16 - 4.17 -@mkisofs_args = ("-iso-level", "4", "-r", "-quiet"); 4.18 - 4.19 -@mkisofs_args = (@mkisofs_args, @graft_points); 4.20 - 4.21 - 4.22 -# get size of stuff 4.23 -$size = `mkisofs -print-size @mkisofs_args 2>/dev/null`; 4.24 -chomp($size); 4.25 - 4.26 -@burn_command = ("cdrecord", "gracetime=3", "-v", 4.27 - "tsize=".$size."s", "-data", "-"); 4.28 - 4.29 -$final_command = "mkisofs @mkisofs_args | @burn_command"; 4.30 - 4.31 -print "$final_command\n"; 4.32 -system($final_command); 4.33 -
5.1 --- a/luks-headers-backup.pl Thu Jan 29 20:47:48 2015 -0800 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,19 +0,0 @@ 5.4 -#!/bin/perl 5.5 - 5.6 - 5.7 - 5.8 -sub backup { 5.9 - my $uuid = shift; 5.10 - my @command = 5.11 - ("cryptsetup", "luksHeaderBackup", "--header-backup-file", 5.12 - "./$uuid.luksHeader", "/dev/disk/by-uuid/$uuid"); 5.13 - print("@command\n"); 5.14 - system(@command); 5.15 -} 5.16 - 5.17 -# TODO -- find all luks drives and do this automatically. 5.18 - 5.19 -&backup("fd14a1d5-ece0-43c4-a3c5-eb93af261cb5"); 5.20 -&backup("23d75d33-611b-424b-810a-099aef0bdd57"); 5.21 -&backup("8543575b-25cc-4132-88ef-39af98f646ae"); 5.22 -&backup("da9b2d38-bb64-459f-b1c8-480b790a2a50");