Backup of today's file

Hiii,

Here is the part o fmy script-


for file in $FileList
        do
                if [[ $(ls -l $file 2>/dev/null) = *$today* ]];
                then
                        echo "Skips $file file. It is todays file"
                        if [[ $isBackup -eq 1 ]];then
                            cp $file $BackupLocation 2>/dev/null
                            cat /dev/null >$file
                        fi
                        continue
                fi

                if [[ $isBackUp -eq 1 ]]
                then
                        mv $file $BackupLocation 2>/dev/null
                        #cat /dev/null > $file
                else
                        rm $file $BackupLocation 2>/dev/null
                        #cat /dev/null >$file
                fi
        done
fi

The problem exists in the today's file,i need to take the backup of the today's file also and then make the content 0 of that file,but what i have writen is not doing so,can you guys give me some suggestion how i can do that.I need a quick response guys,stucked in between.If you have any doubt regarding the question then let me know i will try to clarify it.

Thanks

What does "make the content 0" of a file mean?
echo 0 > $file
is what occurs to me, but I think it's unlikely that you want to to that.

The content of the file need to be 0 because today's file can grow up to a very large size,we need not to delete the file, because the server will pick these files and then again start writing in them,(if we delete the files then we need to start and stop the server again n again)files can be made 0 with this

cat /dev/null >$file
or >$file

this is done through a cron job.

Perhaps he wants to empty the file. :confused: