Skip Menu |

This queue is for tickets about the Snapback2 CPAN distribution.

Report information
The Basics
Id: 57411
Status: new
Priority: 0/
Queue: Snapback2

People
Owner: Nobody in particular
Requestors: madams [...] phantomware.ca
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: cp fails when copying daily.0 to weekly.0 (broken symbolic links)
Date: Wed, 12 May 2010 01:56:30 -0600
To: bug-Snapback2 [...] rt.cpan.org
From: madams [...] phantomware.ca (Matt Adams)

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #57411] AutoReply: cp fails when copying daily.0 to weekly.0 (broken symbolic links)
Date: Thu, 13 May 2010 01:03:19 -0600
To: bug-Snapback2 [...] rt.cpan.org
From: madams [...] phantomware.ca (Matt Adams)
For further clarification, this appears to be a problem with GNU cp as implemented on OpenBSD (I was wrong - it works just fine on Linux). I am experimenting with some alternatives to GNU cp (e.g., cpio). If you do happen to come up with a solution I would be more than interested in hearing it. Thank you, Matt
CC: bug-Snapback2 [...] rt.cpan.org
Subject: Re: [rt.cpan.org #57411] AutoReply: cp fails when copying daily.0 to weekly.0 (broken symbolic links)
Date: Fri, 14 May 2010 00:50:16 -0600
To: madams [...] phantomware.ca (Matt Adams)
From: madams [...] phantomware.ca (Matt Adams)
The following patch to Backup::Snapback (Snapback.pm) allowed Snapback2 to operate on OpenBSD properly. Perhaps this could be integrated properly by expanding the "Cp" configuration parameter to be customizable, for example: Cp /usr/local/bin/gcp -al $target $destination and for backwards compatibility assume that a simple entry, e.g., Cp /usr/local/bin/gcp meant to append "-al $target $destination." If "Cp" were this flexible then I could have customized it to work on OpenBSD simply by configuring it as follows: Cp cd $target && find . -depth -print | cpio -pdl $destination This is merely a suggestion but it would be very nice to see this included upstream, thereby making Snapback2 more portable. Below is the patch that I used: # diff -u Snapback.pm /usr/libdata/perl5/Backup/Snapback.pm --- Snapback.pm Thu May 13 12:56:57 2010 +++ /usr/libdata/perl5/Backup/Snapback.pm Thu May 13 13:32:22 2010 @@ -849,8 +849,8 @@ elsif (-d "$dir.1") { ## 3.2: Hard link from the newest backup: $self->log_debug("Hard Link newest backup: $cp -al $dir.1 $dir.0\n"); - system("$cp -al $dir.1 $dir.0") == 0 - or die "FAILED: $cp -al $dir.0 $dir.1"; + system("cd $dir.1 && find . -depth -print | cpio -pdl $dir.0") == 0 + or die "FAILED: cd $dir.1 && find . -depth -print | cpio -pdl $dir.0"; } } @@ -1219,8 +1219,8 @@ ## 3.2: Hard link from the newest backup: if (! $many_files and ! $retain and -d "$backupdir.0") { $self->log_debug("Hard Link newest backup\n"); - system("$cp -al $backupdir.0 $backupdir.1") == 0 - or die "FAILED: $cp -al $backupdir.0 $backupdir.1"; + system("cd $backupdir.0 && find . -depth -print | cpio -pdl $backupdir.1") == 0 + or die "FAILED: cd $backupdir.0 && find . -depth -print | cpio -pdl $backupdir.1"; } my $extra_ropts = ''; @@ -1339,8 +1339,8 @@ ## No rsync necessary, just hard-link from the most-recent hourly. if (-d "$yesterdays_hourly") { - system("$cp -al $yesterdays_hourly $backupdir.0") == 0 - or die "FAILED: $cp -al $yesterdays_hourly $backupdir.0"; + system("cd $yesterdays_hourly && find . -depth -print | cpio -pdl $backupdir.0") == 0 + or die "FAILED: cd $yesterdays_hourly && find . -depth -print | cpio -pdl $backupdir.0"; } } @@ -1349,8 +1349,8 @@ $backupdir = $prefix . $weekly_dir; $self->rotate($self->config(-Weeklies), $backupdir, $rotate_all); if (-d "$yesterdays_hourly") { - system("$cp -al $yesterdays_hourly $backupdir.0") == 0 - or die "FAILED: $cp -al $yesterdays_hourly $backupdir.0"; + system("cd $yesterdays_hourly && find . -depth -print | cpio -pdl $backupdir.0") == 0 + or die "FAILED: cd $yesterdays_hourly && find . -depth -print | cpio -pdl $backupdir.0"; } } @@ -1359,8 +1359,8 @@ $backupdir = $prefix . $monthly_dir; $self->rotate($self->config(-Monthlies), $backupdir, $rotate_all); if (-d "$yesterdays_hourly") { - system("$cp -al $yesterdays_hourly $backupdir.0") == 0 - or die "FAILED: $cp -al $yesterdays_hourly $backupdir.0"; + system("cd $yesterdays_hourly && find . -depth -print | cpio -pdl $backupdir.0") == 0 + or die "FAILED: cd $yesterdays_hourly && find . -depth -print | cpio -pdl $backupdir.0"; } } }