#!/bin/bash file="/home/test.txt" now_time=`date -u "+%Y-%m-%d %H:%M:%S" -d "8 hour"` if [ ! -f "$file" ];then echo "check time:[$now_time] file $file not exist!" exit 0 fi