/[vz-tools]/trunk/vz-clone.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/vz-clone.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by dpavlin, Thu Oct 4 16:58:01 2007 UTC revision 24 by dpavlin, Thu Oct 4 18:54:41 2007 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
4  use Shell qw/rsync vzlist lvcreate mount umount lvremove which ssync lvdisplay mke2fs/;  use Shell qw/rsync vzlist lvcreate mount umount lvremove which lvdisplay mke2fs/;
5    
6  my $vz   = '/vz';  my $vz   = '/vz';
7  my $conf = '/etc/vz/conf';  my $conf = '/etc/vz/conf';
# Line 44  sub fs_quota { Line 44  sub fs_quota {
44    
45  sub copy_files {  sub copy_files {
46          my ( $from, $to ) = @_;          my ( $from, $to ) = @_;
47          if ( which('ssync') ) {          warn "rsync $from -> $to\n";
48                  warn "ssync $from -> $to\n";          rsync('-raSHAD', "$from/", "$to/" );
                 ssync(qw{--log-mode file --log-path /dev/null},'-f',$from,'-t',$to);  
         } else {  
                 warn "rsync $from -> $to\n";  
                 rsync('-ra', "$from/", "$to/" );  
         }  
49  }  }
50    
51  if ( $vz_lv ) {  if ( $vz_lv ) {
# Line 109  if ( $vz_lv ) { Line 104  if ( $vz_lv ) {
104    
105          print "Cleanup\n";          print "Cleanup\n";
106    
107          umount( "$vz_lv_path/$clone" );          #umount( "$vz_lv_path/$clone" );
108          umount( "$vz_lv_path/$snap" );          umount( "$vz_lv_path/$snap" );
109    
110          lvremove( '-f', "$vz_lv_path/$snap" );          lvremove( '-f', "$vz_lv_path/$snap" );

Legend:
Removed from v.23  
changed lines
  Added in v.24

  ViewVC Help
Powered by ViewVC 1.1.26