AlertPowerMT        getLMS-Multi-MikroTik-StatsByLMS        syncLMS-Multi-MikroTik-DHCP        syncLMS-Multi-MikroTik-PPPoE       

debian

 

poradniki

 

walidacja kopii zapasowej

   25-03-2017 22:00:00       Odwiedziny: 641

Sprawdzanie listy plików po przez sumę kontrolną md5:
pathOriginal="/media/dane/"; \
pathBackups="/media/backups/"; \
cd $pathOriginal; \
find ./ -type f | sort > /tmp/md5_original; \
cd $pathBackups; \
find ./ -type f | sort > /tmp/md5_backups; \
md5Org=`md5sum /tmp/md5_original | awk '{print $1}'`; \
md5Bac=`md5sum /tmp/md5_backups | awk '{print $1}'`; \
rm /tmp/md5_*; \
if [ "$md5Org" == "$md5Bac" ] && [ "" != "$md5Bac" ]; \
then echo -e "\nok\n"; \
else echo -e "\nerror\n"; fi


Sprawdzanie listy plików oraz folderów po przez sumę kontrolną md5:
pathOriginal="/media/dane/"; \
pathBackups="/media/backups/"; \
cd $pathOriginal; \
find ./ | sort > /tmp/md5_original; \
cd $pathBackups; \
find ./ | sort > /tmp/md5_backups; \
md5Org=`md5sum /tmp/md5_original | awk '{print $1}'`; \
md5Bac=`md5sum /tmp/md5_backups | awk '{print $1}'`; \
rm /tmp/md5_*; \
if [ "$md5Org" == "$md5Bac" ] && [ "" != "$md5Bac" ]; \
then echo -e "\nok\n"; \
else echo -e "\nerror\n"; fi


Sprawdzanie sumy kontrolnej md5 każdego pliku:
pathOriginal="/media/dane/"; \
pathBackups="/media/backups/"; \
cd $pathOriginal; \
find ./ -type f -exec md5sum {} \; | sort > /tmp/md5_original; \
cd $pathBackups; \
find ./ -type f -exec md5sum {} \; | sort > /tmp/md5_backups; \
md5Org=`md5sum /tmp/md5_original | awk '{print $1}'`; \
md5Bac=`md5sum /tmp/md5_backups | awk '{print $1}'`; \
rm /tmp/md5_*; \
if [ "$md5Org" == "$md5Bac" ] && [ "" != "$md5Bac" ]; \
then echo -e "\nok\n"; \
else echo -e "\nerror\n"; fi



Copyright seszu © 30.10.2010-2024.