#!/usr/bin/env python3
""" Move big or overtimed logs to backup """

import os
import logging
import argparse
import yaml
from tplogtools.timetools import local_tz_now
from tplogtools.logrotlib import process_path, run_compressors


def main():
    """Argument parse and main loop over given paths"""
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('-c', '--conf', required=True, help='Path to config yml file')
    parser_interval = parser.add_mutually_exclusive_group()
    parser_interval.add_argument(
        '--hourly',
        action='store_true',
        help='Use rules configured as "hourly"'
    )
    parser_interval.add_argument(
        '--daily',
        action='store_true',
        help='Use rules configured as "daily"'
    )
    parser.add_argument(
        'path',
        nargs='+',
        help='Path to folder with log'
    )
    args = parser.parse_args()
    with open(args.conf) as conf_file:
        conf = yaml.safe_load(conf_file)
    interval = 'daily' if args.daily else 'hourly' if args.hourly else ''
    compressors = []
    now = local_tz_now()
    for path in args.path:
        compressors += process_path(now, conf, interval, os.path.abspath(path))
    if compressors:
        run_compressors(compressors)


if __name__ == '__main__':
    logging.basicConfig(level=logging.ERROR)
    main()

015ed8616503b6c554941159477202b6a172215a
<mask token>

<mask token>


def main():
    """Argument parse and main loop over given paths"""
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('-c', '--conf', required=True, help=
        'Path to config yml file')
    parser_interval = parser.add_mutually_exclusive_group()
    parser_interval.add_argument('--hourly', action='store_true', help=
        'Use rules configured as "hourly"')
    parser_interval.add_argument('--daily', action='store_true', help=
        'Use rules configured as "daily"')
    parser.add_argument('path', nargs='+', help='Path to folder with log')
    args = parser.parse_args()
    with open(args.conf) as conf_file:
        conf = yaml.safe_load(conf_file)
    interval = 'daily' if args.daily else 'hourly' if args.hourly else ''
    compressors = []
    now = local_tz_now()
    for path in args.path:
        compressors += process_path(now, conf, interval, os.path.abspath(path))
    if compressors:
        run_compressors(compressors)


<mask token>

<mask token>


def main():
    """Argument parse and main loop over given paths"""
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('-c', '--conf', required=True, help=
        'Path to config yml file')
    parser_interval = parser.add_mutually_exclusive_group()
    parser_interval.add_argument('--hourly', action='store_true', help=
        'Use rules configured as "hourly"')
    parser_interval.add_argument('--daily', action='store_true', help=
        'Use rules configured as "daily"')
    parser.add_argument('path', nargs='+', help='Path to folder with log')
    args = parser.parse_args()
    with open(args.conf) as conf_file:
        conf = yaml.safe_load(conf_file)
    interval = 'daily' if args.daily else 'hourly' if args.hourly else ''
    compressors = []
    now = local_tz_now()
    for path in args.path:
        compressors += process_path(now, conf, interval, os.path.abspath(path))
    if compressors:
        run_compressors(compressors)


if __name__ == '__main__':
    logging.basicConfig(level=logging.ERROR)
    main()

<mask token>
import os
import logging
import argparse
import yaml
from tplogtools.timetools import local_tz_now
from tplogtools.logrotlib import process_path, run_compressors


def main():
    """Argument parse and main loop over given paths"""
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('-c', '--conf', required=True, help=
        'Path to config yml file')
    parser_interval = parser.add_mutually_exclusive_group()
    parser_interval.add_argument('--hourly', action='store_true', help=
        'Use rules configured as "hourly"')
    parser_interval.add_argument('--daily', action='store_true', help=
        'Use rules configured as "daily"')
    parser.add_argument('path', nargs='+', help='Path to folder with log')
    args = parser.parse_args()
    with open(args.conf) as conf_file:
        conf = yaml.safe_load(conf_file)
    interval = 'daily' if args.daily else 'hourly' if args.hourly else ''
    compressors = []
    now = local_tz_now()
    for path in args.path:
        compressors += process_path(now, conf, interval, os.path.abspath(path))
    if compressors:
        run_compressors(compressors)


if __name__ == '__main__':
    logging.basicConfig(level=logging.ERROR)
    main()

#!/usr/bin/env python3
""" Move big or overtimed logs to backup """

import os
import logging
import argparse
import yaml
from tplogtools.timetools import local_tz_now
from tplogtools.logrotlib import process_path, run_compressors


def main():
    """Argument parse and main loop over given paths"""
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('-c', '--conf', required=True, help='Path to config yml file')
    parser_interval = parser.add_mutually_exclusive_group()
    parser_interval.add_argument(
        '--hourly',
        action='store_true',
        help='Use rules configured as "hourly"'
    )
    parser_interval.add_argument(
        '--daily',
        action='store_true',
        help='Use rules configured as "daily"'
    )
    parser.add_argument(
        'path',
        nargs='+',
        help='Path to folder with log'
    )
    args = parser.parse_args()
    with open(args.conf) as conf_file:
        conf = yaml.safe_load(conf_file)
    interval = 'daily' if args.daily else 'hourly' if args.hourly else ''
    compressors = []
    now = local_tz_now()
    for path in args.path:
        compressors += process_path(now, conf, interval, os.path.abspath(path))
    if compressors:
        run_compressors(compressors)


if __name__ == '__main__':
    logging.basicConfig(level=logging.ERROR)
    main()
