code-dumps/py/test.py

9 lines
158 B
Python
Raw Normal View History

2024-10-24 23:09:21 +08:00
#!/usr/bin/env python
import os, time
fileage = os.path.getmtime('/var/log/ufw.log');
if time.time() - fileage > 7200:
print ('File is > 2 hours old')