server = settings.TELECASTER_RSYNC_SERVER
log = settings.TELECASTER_RSYNC_LOG
logger = Logger(log)
- command = 'rsync -aq '
-
+ command = 'rsync -aq '
+
def handle(self, *args, **options):
- stations = Station.objects.filter(started=True)
- ids = [station.public_id for station in stations]
- if ids:
- for id in ids:
- self.command += '--exclude=%s ' % id
- self.command += self.archives + ' ' + self.server
- try:
- os.system(self.command)
- self.logger.write_info(self.command)
- except:
- self.logger.write_error('NOT rsynced')
-
\ No newline at end of file
+ pid = get_pid('rsync')
+ if not pid:
+ stations = Station.objects.filter(started=True)
+ ids = [station.public_id for station in stations]
+ if ids:
+ for id in ids:
+ self.command += '--exclude=%s ' % id
+ self.command += self.archives + ' ' + self.server
+ try:
+ os.system(self.command)
+ self.logger.write_info(self.command)
+ except:
+ self.logger.write_error('NOT rsynced')
dict = xmltodict(conf_xml,'utf-8')
return dict
-import psutil
-
-PROCNAME = "deefuzzer"
-PROCARGS = ".telecaster/deefuzzer_webm.xml"
-
-
-
-
def get_pid(name, args=None):
"""Get a process pid filtered by arguments and uid"""
pids = []