mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
added pid to backup file name to avoid collisions
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user