Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Hardlinks as Undelete Solution

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Hardlinks as Undelete Solution

#1 Post by bester69 »

Hi,

Ive got the idea of using a FIFO hardlinks backups in a target root hidden folder for each ntfs partition, with a scheduled retention of some weeks/days, so we can undelete missed/lost accidentally files/folders that usually happends from time to time. As we're only backing up hardlinks, most of time we wont spare space disk, and at the same time, we will be able to recover typical important files ocassionally we delete accidentally. Last day I deleted by accidentally a 2Gb wine botle and couldnt recover it cos I cant backup all files and partitions; Now, with theses hardlinks copies I will be able to workaround this matter, if it happens again. :o

Here, a tested script (with 6 retentions) Im using in crontab.weekly for each NTFS partition:

bak_sda1.sh

Code: Select all

#########COPIA SDA1 BACKUP HARDLINKS#######################
################################
HLBACK=/media/sda1/.SDA1
HLSOURCE=/media/sda1
HLNAME=`date +%Y%m%d_%H:%M:%S`
################################
HL1=$(cat  $HLBACK/.1.dt)
HL2=$(cat  $HLBACK/.2.dt)
HL3=$(cat  $HLBACK/.3.dt)
HL4=$(cat  $HLBACK/.4.dt)
HL5=$(cat  $HLBACK/.5.dt)

sleep 2
rm -rf $HLBACK/1-*
mv $HLBACK/2-$HL1 $HLBACK/1-$HL1
rm -rf $HLBACK/2-*
mv $HLBACK/3-$HL2 $HLBACK/2-$HL2
rm -rf $HLBACK/3-*
mv $HLBACK/4-$HL3 $HLBACK/3-$HL3
rm -rf $HLBACK/4-*
mv $HLBACK/5-$HL4 $HLBACK/4-$HL4
rm -rf $HLBACK/5-*
mv $HLBACK/6-$HL5 $HLBACK/5-$HL5

rm -rf $HLBACK/6-*
mkdir  $HLBACK/6-$HLNAME

###########
clear
echo "Directorios:"
find $HLSOURCE -maxdepth 1 -type d  -iname "*"  -not -path "$HLBACK" -not -path "$HLSOURCE" 
echo "Archivos:"
find $HLSOURCE -maxdepth 1 -type f -iname "*"  -not -path "$HLBACK" -not -path "$HLSOURCE"
sleep 5
find $HLSOURCE -maxdepth 1 -type d  -iname "*"  -not -path "$HLBACK" -not -path "$HLSOURCE" -exec cp -larv "{}" $HLBACK/6-$HLNAME  \;
find $HLSOURCE -maxdepth 1 -type f -iname "*"  -not -path "$HLBACK" -not -path "$HLSOURCE" -exec cp -larv "{}" $HLBACK/6-$HLNAME  \;
###########

cat  $HLBACK/.2.dt >  $HLBACK/.1.dt
cat  $HLBACK/.3.dt >  $HLBACK/.2.dt
cat  $HLBACK/.4.dt >  $HLBACK/.3.dt
cat  $HLBACK/.5.dt >  $HLBACK/.4.dt
echo "$HLNAME" > $HLBACK/.5.dt
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

Post Reply