File doesnt work as wished

Hi there
I made a script that should compress and delete files but it doesn’t work as wished.
What should I change so that it can compress and delete files.

require 'fileutils'
require 'date'
require "zlib"

data_to_compress ="don_quixote.txt")
current_day =

# This will get log files for all subdirectories
Dir["\\ss002207\TAAHAMO1$\Desktop\Test\test.log"].each do |file|
  file_day = File.mtime(file).to_datetime.jd

  if current_day - file_day >= 1
    FileUtils.rm file