Created
January 20, 2014 19:41
-
-
Save ivanelson/8527571 to your computer and use it in GitHub Desktop.
I will check the integrity of hardlink's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat=`zimfiles +v | grep -iE " catalogo " | awk '{ print $5 }'` | |
cat_serv=`zimfiles +v | grep -iE " catalogo_serv " | awk '{ print $5 }'` | |
inode1=`ls -i $cat | awk '{ print $1 }'` | |
inode2=`ls -i $cat_serv | awk '{ print $1 }'` | |
if [ "$inode1" != "$inode2" ] # Use the "inode" file to compare with the actual file. | |
then | |
echo "Criando link do catalogo em `date`" >> $HOME/loglinkcat | |
ln -f $cat $cat_serv | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment