diff cd-simple-burn.pl @ 20:d1607d25ffba

add unencrypted cd backup.
author Robert McIntyre <rlm@mit.edu>
date Thu, 23 May 2013 22:52:18 -0400
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/cd-simple-burn.pl	Thu May 23 22:52:18 2013 -0400
     1.3 @@ -0,0 +1,30 @@
     1.4 +#!/bin/perl
     1.5 +
     1.6 +use File::Basename;
     1.7 +
     1.8 +$tmp_iso="/home/r/tmp/image.iso";
     1.9 +
    1.10 +@graft_points = ("-graft-points");
    1.11 +
    1.12 +for $graft_point(@ARGV){
    1.13 +    push(@graft_points, '"'. basename($graft_point) .'"' . "=" 
    1.14 +	 . '"'. $graft_point . '"');
    1.15 +}
    1.16 +
    1.17 +@mkisofs_args =  ("-iso-level", "4", "-r", "-quiet");
    1.18 +
    1.19 +@mkisofs_args = (@mkisofs_args, @graft_points);
    1.20 +
    1.21 +
    1.22 +# get size of stuff
    1.23 +$size = `mkisofs -print-size @mkisofs_args 2>/dev/null`;
    1.24 +chomp($size);
    1.25 +
    1.26 +@burn_command = ("cdrecord", "gracetime=3", "-v",
    1.27 +		 "tsize=".$size."s", "-data", "-");
    1.28 +
    1.29 +$final_command = "mkisofs @mkisofs_args |  @burn_command";
    1.30 +
    1.31 +print "$final_command\n";
    1.32 +system($final_command);
    1.33 +