fixed cron
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.1.0 (2012-10-11 09:23:31) dev
|
Version 2.1.0 (2012-10-11 16:48:00) dev
|
||||||
|
|||||||
+7
-3
@@ -314,22 +314,26 @@ def crondance(applications_parent, ctype='soft', startup=False, apps=None):
|
|||||||
(action,models,command) = (True,'-M',command[1:])
|
(action,models,command) = (True,'-M',command[1:])
|
||||||
else:
|
else:
|
||||||
action=False
|
action=False
|
||||||
|
|
||||||
if action and command.endswith('.py'):
|
if action and command.endswith('.py'):
|
||||||
commands.extend(('-J', # cron job
|
commands.extend(('-J', # cron job
|
||||||
models, # import models?
|
models, # import models?
|
||||||
'-S', app, # app name
|
'-S', app, # app name
|
||||||
'-a', '"<recycle>"', # password
|
'-a', '"<recycle>"', # password
|
||||||
'-R', command)) # command
|
'-R', command)) # command
|
||||||
shell = True
|
|
||||||
elif action:
|
elif action:
|
||||||
commands.extend(('-J', # cron job
|
commands.extend(('-J', # cron job
|
||||||
models, # import models?
|
models, # import models?
|
||||||
'-S', app+'/'+command, # app name
|
'-S', app+'/'+command, # app name
|
||||||
'-a', '"<recycle>"')) # password
|
'-a', '"<recycle>"')) # password
|
||||||
shell = True
|
|
||||||
else:
|
else:
|
||||||
commands = command
|
commands = command
|
||||||
shell = False
|
|
||||||
|
# from python docs:
|
||||||
|
# You do not need shell=True to run a batch file or
|
||||||
|
# console-based executable.
|
||||||
|
shell = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cronlauncher(commands, shell=shell).start()
|
cronlauncher(commands, shell=shell).start()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|||||||
Reference in New Issue
Block a user