Opened 18 years ago
Closed 7 years ago
#1020 closed enhancement (worksforme)
Auto-backup (hotcopy) with "overwrite" function
Reported by: | Radoslaw Stachowiak | Owned by: | anybody |
---|---|---|---|
Priority: | normal | Component: | Request-a-Hack |
Severity: | major | Keywords: | backup |
Cc: | Trac Release: | 0.10 |
Description
Hi,
I just setup Trac for one project and realized that trac-admin allows to backup the trac project environment using hotcopy command.
However, when I did that it says: Command failed: [Errno 17] File exists:
This behaviour is discussed in the ticket Trac-3198 with the suggestion: """ You're better off moving the previous hotcopy to a temp location, make a new hotcopy, then remove the temp location once the hotcopy has completed successfully. """
I propose to add this suggested functionality as a hack to the hotcopy command, so the command could be called:
trac-admin /trac hotcopy /trac-backup /tmp
Attachments (0)
Change History (6)
comment:1 Changed 18 years ago by
comment:3 Changed 18 years ago by
I would keep the original hotcopy functionality and add extended one as well. The steps could be:
Current functionality remains in case we call (ie. it gives error in case of existing backup dir):
trac-admin <trac dirhotcopy <backup dir>
Extended functionality in case:
trac-admin <trac dirhotcopy <backup dir<tmpdir>
with these steps:
- check if that <backup dir already exists
- if yes, move the <backup dirfolder under <tmpdir(forcing overwrite )
- if that fails, stop here (previous backup attempt that got interrupted? anyway, manual clean-up needed)
- do the hotcopy in <backup>
- remove <backup dirfrom <tmpdir>.
I believe, that this is better approach as you do not need to have write permission into the parent dir of <trac diras it is in case of tracproject.old approach. Of cource I assume write permissions to the declared <tmpdir>.
comment:4 Changed 16 years ago by
It's not a hack to TracAdmin itself as requested, but TracHotBackupScript may give you the functionality you're looking for. In your case, try running it with --num-backups=1. Each backup will have a different (time-stamped) name, but that small inconvenience is easily overlooked should you need to restore that backup someday.
comment:5 Changed 15 years ago by
Summary: | auto-backup (hotcopy) with "overwrite" function → Auto-backup (hotcopy) with "overwrite" function |
---|
comment:6 Changed 7 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
trac-admin
is currently not extensbile by plugins. A more possible request would be to make a web UI to generate backups.