Example #1
0
def _log_end(task):
    """Create the End time info block and send & write the log."""
    _notify("Rsync", "Ended", "ok")
    LOG.time("End time")
    LOG.free(os.linesep * 2)
    LOG.write(True)
    LOG.send("Fabric Rsync ({0})".format(task))
Example #2
0
def _log_end(task):
    """Create the End time info block and send & write the log."""
    _notify("Rsync", "Ended", "ok")
    LOG.time("End time")
    LOG.free(os.linesep * 2)
    LOG.write(True)
    LOG.send("Fabric Rsync ({0})".format(task))
Example #3
0
def _rsync(source, target, delete):
    """Process the _rsync command."""
    _log_start()
    LOG.header("Fabric Rsync\nhttp://joedicastro.com", "Syncing {0} to {1}".format(source, target))
    _notify("Rsync", "Start syncing {0} to {1}".format(source, target), "info")
    out = local(
        "rsync -pthrvz {2} {0}/ {1}".format(source, target, "--delete" if delete == "yes" else ""), capture=True
    )
    _notify("Rsync", "Finished synchronization", "ok")
    LOG.list("Rsync Output", out)
    if out.failed:
        LOG.list("Rsync Errors", out.stderr)
Example #4
0
def _rsync(source, target, delete):
    """Process the _rsync command."""
    _log_start()
    LOG.header("Fabric Rsync\nhttp://joedicastro.com",
               "Syncing {0} to {1}".format(source, target))
    _notify("Rsync", "Start syncing {0} to {1}".format(source, target), "info")
    out = local("rsync -pthrvz {2} {0}/ {1}".format(
        source, target, "--delete" if delete == "yes" else ""),
                capture=True)
    _notify("Rsync", "Finished synchronization", "ok")
    LOG.list("Rsync Output", out)
    if out.failed:
        LOG.list("Rsync Errors", out.stderr)
Example #5
0
def _archive():
    """Archive the local directory in a gz file for each weekday."""
    _notify("Rsync", "Compressing folder...", "info")
    LOG.list("Rotate compressed copies", _compress(env.local))
    _notify("Rsync", "Finished compression", "ok")
Example #6
0
def _archive():
    """Archive the local directory in a gz file for each weekday."""
    _notify('Rsync', 'Compressing folder...', 'info')
    LOG.list('Rotate compressed copies', _compress(env.local))
    _notify("Rsync", "Finished compression", "ok")