Tag Archives: Rotate

Simple tool for rotating nginx log file

#!/bin/env python “””Simple tool for rotating nginx log file @author: Victor Lin (bornstub@gmail.com) blog: http://blog.ez2learn.com “”” import os import shutil import optparse import datetime import logging import subprocess log = logging.getLogger(__name__) def main(): parser = optparse.OptionParser() parser.add_option(‘-p’, ‘–pid’, dest=’pidFile’, metavar=”FILE”, … Continue reading

Posted in English Articles, Python | Tagged , , , , | 1 Comment