is there an easy workaround (apart from disabling the backup sw)?
You could just keep trying to rename it...
1 until rename $file1, $file2;
Of course, if a file can genuinely never be renamed, this will cause your script to keep trying forever. Better to limit to a finite number of attempts at renaming.
my $attempts;
while (not rename $file1, $file2)
{
$attempts++;
die "Could not rename file: $!" if $attempts > 7;
sleep $attempts;
}
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'