The few comments I have are that it is unknown whether you are running BASH or some other script language because you did not post enough of your script. Please use [code] tags in the future, see my signature or the LQ FAQ for further help with that.
The most common complaint for such a test like that is that the variable is not resolved or defined to be a value. Check what the output of $DiffYear is using echo. As far as the second comparison, the variable $DownLoadNotifyDaysNoFtp is not defined, at least not in the section shown.
A further recommendation is to use all CAPS for variable names.
Just prior to the section you can use "set -xv" to enable more debug and then after the section "set +xv" to revert back to normal. So when you run the script in a terminal you'll see details of variable assignments, what values are being compared, and what the outcomes are, same as if you used echo to output all.
Sample script:
Code:
#!/bin/sh
set -xv
VAL=5
if [ ${VAL} -eq 5 ]
then
echo "true"
fi
set +xv
if [ ${VAL} -ge 4 ]
then
echo "also true"
fi
Sample output:
Code:
$ ./compare.sh
VAL=5
+ VAL=5
if [ ${VAL} -eq 5 ]
then
echo "true"
fi
+ '[' 5 -eq 5 ']'
+ echo true
true
set +xv
+ set +xv
also true