$nice mv $dir.$i $dir.$next
mkdir -p $backuproot/metadata/$rottype.$next
date +%c%n%s > $backuproot/metadata/$rottype.$next/rotated
+ rm -f $backuproot/metadata/$rottype.$next/created
else
echo "Debug: skipping rotation of $dir.$i because $dir.$next already exists."
fi
$nice mv \$dir.\$i \$dir.\$next
mkdir -p $backuproot/metadata/\$rottype.\$next
date +%c%n%s > $backuproot/metadata/\$rottype.\$next/rotated
+ rm -f $backuproot/metadata/\$rottype.\$next/created
else
echo "Debug: skipping rotation of \$dir.\$i because \$dir.\$next already exists."
fi
done
max=\$((keepdaily+1))
- if [ \$keepweekly -gt 0 -a -d $backuproot/daily.\$max -a ! -d \$backuproot/weekly.1 ]; then
+ if [ \$keepweekly -gt 0 -a -d $backuproot/daily.\$max -a ! -d $backuproot/weekly.1 ]; then
echo "Debug: daily.\$max --> weekly.1"
$nice mv $backuproot/daily.\$max $backuproot/weekly.1
mkdir -p $backuproot/metadata/weekly.1
if [ -d $dir.1 ]; then
if [ -f $metadata/created ]; then
- echo "Warning: $dir.1 already exists. Overwriting contents."
+ echo "Warning: $dir.1 already exists, aborting."
+ exit
else
echo "Warning: we seem to be resuming a partially written $dir.1"
fi
if [ -d $dir.1 ]; then
if [ -f $metadata/created ]; then
- echo "Warning: $dir.1 already exists. Overwriting contents."
+ echo "Warning: $dir.1 already exists, aborting."
+ exit
else
echo "Warning: we seem to be resuming a partially written $dir.1"
fi