I'm trying to compare dates from a file and the current day. The script should run every day and if the dates do not compare it should give a warning.
I made a test file with a 2015 date, but it keeps saying its "equal" to the current date.
#!/bin/bash
today= date +"%m-%d-%y"
filedate= date +"%m-%d-%y" -r fileName.txt
if [ $today == $filedate ];
then
echo $today;
echo $filedate;
echo 'Backup OK';
else
echo $today;
echo $filedate;
echo 'Backup ERROR';
fi