# read file and write to archive  
File.open("archive.log", "a") do |saved|  
    File.foreach("mylogfile.log") do |sending|  
        puts("data = #{sending}")  
        # Make sure we keep a backup  
        saved.puts(sending) # removed superfluous string interpolation  
    end  
end