+
+$rscripts/diff.pl -s $tmpsrc/ -d $tmp/bacula-restores/$tmpsrc/
+if [ $? != 0 ]; then
+ print_debug "ERROR: Found error while restoring a directory"
+ rstat=1
+fi
+
+diff $tmpsrc/ficheriro2.txt $tmp/bacula-restores/$tmpsrc/ficheriro2.txt
+if [ $? != 0 ]; then
+ print_debug "ERROR: ficheriro2.txt is different"
+ rstat=1
+fi
+
+rm -rf $tmp/bacula-restores
+
+cat <<END_OF_DATA >${tmp}/bconcmds
+@$out $tmp/log4.out
+@# Try to restore a hardlinks
+.bvfs_cleanup path=b21
+END_OF_DATA
+
+jidx=`awk -F '\t' '/ficheriro2.txt|hardlinks2/ { lstat=$5 }
+ END { print ".bvfs_decode_lstat lstat=\"" lstat "\""
+} ' $tmp/log3.out | $bin/bconsole -c $conf/bconsole.conf | awk -F= '/LinkFI/ { print $2 } '`
+
+awk '/ficheriro2.txt/ { if (!id) { id=$3 } } /hardlink2/ { if (!id) { id=$3 } }
+ END {
+ print ".bvfs_restore jobid=1,2,3,4,5,6,7,8 hardlink=8,'$jidx' fileid=" id " path=b21"
+ } ' $tmp/log3.out >> $tmp/bconcmds
+
+cat <<END_OF_DATA >>${tmp}/bconcmds
+@$out $tmp/log2.out
+restore file="?b21" where=$tmp/bacula-restores yes
+wait
+messages
+quit
+END_OF_DATA
+
+run_bconsole
+
+test -f $tmp/bacula-restores/$tmpsrc/hardlink2 -a -f $tmp/bacula-restores/$tmpsrc/ficheriro2.txt
+if [ $? != 0 ]; then
+ print_debug "ERROR: Need to get all files"
+ rstat=1
+fi
+
+# Compare Inode
+ls -i $tmp/bacula-restores/$tmpsrc/hardlink2 | awk ' { print $1 } ' > $tmp/1
+ls -i $tmp/bacula-restores/$tmpsrc/ficheriro2.txt | awk ' { print $1 } ' > $tmp/2
+diff $tmp/1 $tmp/2 > /dev/null
+if [ $? != 0 ]; then
+ print_debug "ERROR: Both files should have the same inode number"
+ rstat=1
+fi
+