AlertPowerMT        Change Settings Network Devices        syncLMS-One-MikroTik-SimpleQueues        getLMS-Multi-MikroTik-StatsByLMS       

debian

 

poradniki

 

walidacja kopii zapasowej

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

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-2020.