cat rm.py
#!/usr/bin/python3
# coding=utf-8
# */12 * * * * /usr/bin/python3 /data/mon/rm.py
import os
import shutil
mypath = '/data/backup/'
#os.removedirs(path) #空目录才行
shutil.rmtree(mypath)
os.mkdir(mypath)
# os.mkdir(path, mode=0o777, *, dir_fd=None)