save_firstrun

in chefctl/src/chefctl.rb [1109:1131]


    def save_firstrun
      unless File.exist?(@paths[:first])
        
        
        
        
        
        
        
        oldest_log = Dir.glob(File.join(@paths[:logdir], 'chef.2*')).min
        if @paths[:out] == oldest_log
          Chefctl.logger.debug("Copying first-run log to #{@paths[:first]}")
          
          
          FileUtils.cp(@paths[:out], @paths[:first])
        else
          Chefctl.logger.debug("No first-run log at #{@paths[:first]}, but " +
            "the current log (#{@paths[:out]}) isn't the oldest log " +
            "(#{oldest_log}), so we're not copying to #{@paths[:first]}.")
        end
      end
    end