From: yomguy Date: Mon, 16 Jul 2012 10:06:26 +0000 (+0200) Subject: add bw limit to rsync X-Git-Tag: 0.9~60 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f530f514f697172a0f9d41542ab4b8019ddc3460;p=telecaster-client.git add bw limit to rsync --- diff --git a/telecaster/management/commands/telecaster-rsync-archives.py b/telecaster/management/commands/telecaster-rsync-archives.py index bf8f598..405085e 100644 --- a/telecaster/management/commands/telecaster-rsync-archives.py +++ b/telecaster/management/commands/telecaster-rsync-archives.py @@ -13,6 +13,7 @@ import os class Command(BaseCommand): help = "Synchronize local archives with backup server" admin_email = 'webmaster@parisson.com' + args = 'max-bandwith-in-kBps' archives = settings.MEDIA_ROOT server = settings.TELECASTER_RSYNC_SERVER log = settings.TELECASTER_RSYNC_LOG @@ -22,6 +23,11 @@ class Command(BaseCommand): def handle(self, *args, **options): pid = get_pid('rsync') if not pid: + try: + bw = args[0] + self.command += '--bwlimit=' + bw + ' ' + except: + pass stations = Station.objects.filter(started=True) ids = [station.public_id for station in stations] if ids: