This commit is contained in:
brent s 2017-09-15 09:47:05 -04:00
parent 28e46f6f51
commit 8ff59fdaf0

View File

@ -54,15 +54,16 @@ def sync(args):
with open(args['lockfile'], 'w') as f: with open(args['lockfile'], 'w') as f:
f.write(str(os.getpid())) f.write(str(os.getpid()))
with open(args['logfile'], 'a') as log: with open(args['logfile'], 'a') as log:
try: # try:
subprocess.call(cmd, stdout = log, stderr = subprocess.STDOUT) # Disabled the try/except because otherwise it complains on broken symlinks. Gah!
now = int(datetime.datetime.timestamp(datetime.datetime.utcnow())) subprocess.call(cmd, stdout = log, stderr = subprocess.STDOUT)
with open(os.path.join(dest['path'], 'lastsync'), 'w') as f: now = int(datetime.datetime.timestamp(datetime.datetime.utcnow()))
f.write(str(now) + '\n') with open(os.path.join(dest['path'], 'lastsync'), 'w') as f:
os.remove(args['lockfile']) f.write(str(now) + '\n')
except: os.remove(args['lockfile'])
os.remove(args['lockfile']) # except:
exit('!! The rsync has failed. See {0} for more details. !!'.format(args['logfile'])) # os.remove(args['lockfile'])
# exit('!! The rsync has failed. See {0} for more details. !!'.format(args['logfile']))
return() return()


def getDefaults(): def getDefaults():