1
0
Fork 0
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:
Brian Coca 2016-07-29 23:03:34 -04:00
parent 36bf1e6b7e
commit 123d54e736

View file

@ -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)