Hacked By AnonymousFox
import logging
import click
from hw_cpbackup import SharedBackupsAgent, __version__
from hw_cpbackup.util.log import logger
try:
from pathlib import Path
except ImportError:
from pathlib2 import Path
@click.group(no_args_is_help=True)
@click.version_option(__version__)
@click.option('--debug', is_flag=True, type=bool, help='enable debug logging')
@click.option('--dry-run', is_flag=True, type=bool, help='review without changes')
@click.pass_context
def cli(ctx, debug, dry_run):
"""Hostwinds Shared Backups Agent"""
if debug:
logger.setLevel(logging.DEBUG)
ctx.ensure_object(dict)
ctx.obj['dry_run'] = dry_run
@cli.command()
@click.option('--clean', '-c', is_flag=True, type=bool, help='clean prior artifacts')
@click.option('--force', '-f', is_flag=True, type=bool, help='force backup process')
@click.option('--no-alert', '-n', is_flag=True, type=bool, help='disable channel alerts')
@click.option('--user', '-u', type=str, help="target user")
@click.pass_context
def run(ctx, clean, force, no_alert, user=None):
"""Run Shared Backups"""
dry_run = ctx.obj['dry_run']
sba = SharedBackupsAgent(clean, force, alert=not no_alert, dry_run=dry_run)
sba.run(user=user)
Hacked By AnonymousFox1.0, Coded By AnonymousFox