]> git.parisson.com Git - telecaster-client.git/commitdiff
add bw limit to rsync
authoryomguy <yomguy@parisson.com>
Mon, 16 Jul 2012 10:06:26 +0000 (12:06 +0200)
committeryomguy <yomguy@parisson.com>
Mon, 16 Jul 2012 10:06:26 +0000 (12:06 +0200)
telecaster/management/commands/telecaster-rsync-archives.py

index bf8f598b2a734bb07f64124b519ed53d193f5560..405085ed1435618690c5cac6bec9edc82cc8e4d4 100644 (file)
@@ -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: