Jani Averbach <jaa@cc.jyu.fi> writes:
> * tools/backup/hot-backup.py: modified
I think you might have sent this before finishing the log message,
Jani...
-Karl
> BR, Jani
>
> Index: tools/backup/hot-backup.py
> ===================================================================
> --- tools/backup/hot-backup.py (revision 4111)
> +++ tools/backup/hot-backup.py (working copy)
> @@ -77,6 +77,15 @@
> # Step 2: copy the whole repository structure.
>
> backup_subdir = os.path.join(backup_dir, repo + "-" + youngest)
> +
> +# if there is backup already, add additional
> +# increment at the end of path
> +try_count = 1
> +while os.path.exists(backup_subdir):
> + backup_subdir = os.path.join(backup_dir, repo + "-" + youngest + "-" + `try_count`)
> + try_count += 1
> +
> +
> print "Backing up repository to '" + backup_subdir + "'..."
> shutil.copytree(repo_dir, backup_subdir)
> print "Done."
> @@ -159,9 +168,19 @@
>
> # Step 8: finally, remove the repository back that's NUM_BACKUPS older
> # than the one we just created.
> +# If there are multible versions of this rep. backup, remove them also
>
> kill_rev = int(youngest) - num_backups
> old_backup_subdir = os.path.join(backup_dir, repo + "-" + `kill_rev`)
> if os.path.exists(old_backup_subdir):
> print "Removing old backup: " + old_backup_subdir
> shutil.rmtree(old_backup_subdir)
> + try_count = 1
> + old_backup_subdir = os.path.join(backup_dir, repo + "-" + `kill_rev` + "-" + `try_count`)
> + while os.path.exists(old_backup_subdir):
> + print "Removing old backup: " + old_backup_subdir
> + shutil.rmtree(old_backup_subdir)
> + try_count += 1
> + old_backup_subdir = os.path.join(backup_dir, repo + "-" + `kill_rev` + "-" + `try_count`)
> +
> +
>
>
> --
> Jani Averbach
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Dec 15 21:46:41 2002