mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Merge pull request #6870 from MorrisA/devel
Modified Cron to add AIX Crontab support
This commit is contained in:
commit
32405fc715
1 changed files with 3 additions and 1 deletions
|
@ -352,6 +352,8 @@ class CronTab(object):
|
||||||
if self.user:
|
if self.user:
|
||||||
if platform.system() == 'SunOS':
|
if platform.system() == 'SunOS':
|
||||||
return "su %s -c '%s -l'" % (pipes.quote(self.user), pipes.quote(CRONCMD))
|
return "su %s -c '%s -l'" % (pipes.quote(self.user), pipes.quote(CRONCMD))
|
||||||
|
elif platform.system() == 'AIX':
|
||||||
|
return "%s -l %s" % (pipes.quote(CRONCMD), (pipes.quote(self.user))
|
||||||
else:
|
else:
|
||||||
user = '-u %s' % pipes.quote(self.user)
|
user = '-u %s' % pipes.quote(self.user)
|
||||||
return "%s %s %s" % (CRONCMD , user, '-l')
|
return "%s %s %s" % (CRONCMD , user, '-l')
|
||||||
|
@ -362,7 +364,7 @@ class CronTab(object):
|
||||||
"""
|
"""
|
||||||
user = ''
|
user = ''
|
||||||
if self.user:
|
if self.user:
|
||||||
if platform.system() == 'SunOS':
|
if platform.system() in [ 'SunOS', 'AIX' ]:
|
||||||
return "chown %s %s ; su '%s' -c '%s %s'" % (pipes.quote(self.user), pipes.quote(path), pipes.quote(self.user), CRONCMD, pipes.quote(path))
|
return "chown %s %s ; su '%s' -c '%s %s'" % (pipes.quote(self.user), pipes.quote(path), pipes.quote(self.user), CRONCMD, pipes.quote(path))
|
||||||
else:
|
else:
|
||||||
user = '-u %s' % pipes.quote(self.user)
|
user = '-u %s' % pipes.quote(self.user)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue