mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
added pid to backup file name to avoid collisions
This commit is contained in:
parent
36bf1e6b7e
commit
123d54e736
1 changed files with 1 additions and 1 deletions
|
@ -1820,7 +1820,7 @@ class AnsibleModule(object):
|
|||
if os.path.exists(fn):
|
||||
# backups named basename-YYYY-MM-DD@HH:MM:SS~
|
||||
ext = time.strftime("%Y-%m-%d@%H:%M:%S~", time.localtime(time.time()))
|
||||
backupdest = '%s.%s' % (fn, ext)
|
||||
backupdest = '%s.%s.%s' % (fn, os.getpid(), ext)
|
||||
|
||||
try:
|
||||
shutil.copy2(fn, backupdest)
|
||||
|
|
Loading…
Reference in a new issue