Ticket #1020 (new enhancement)

Opened 10 months ago

Last modified 10 months ago

auto-backup (hotcopy) with "overwrite" function

Reported by: radek Assigned to: 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

Change History

12/18/06 03:34:41 changed by coderanger

trac-admin is currently not extensbile by plugins. A more possible request would be to make a web UI to generate backups.

12/18/06 06:50:22 changed by radek

I believe this could be applied as patch.

12/18/06 11:24:45 changed by anonymous

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:

  1. check if that <backup dir already exists
  1. if yes, move the <backup dirfolder under <tmpdir(forcing overwrite )
  1. if that fails, stop here (previous backup attempt that got interrupted? anyway, manual clean-up needed)
  1. do the hotcopy in <backup>
  1. 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>.


Add/Change #1020 (auto-backup (hotcopy) with "overwrite" function)




Change Properties
Action