From f530f514f697172a0f9d41542ab4b8019ddc3460 Mon Sep 17 00:00:00 2001 From: yomguy Date: Mon, 16 Jul 2012 12:06:26 +0200 Subject: [PATCH] add bw limit to rsync --- telecaster/management/commands/telecaster-rsync-archives.py | 6 ++++++ 1 file changed, 6 insertions(+) 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: -- 2.39.5