Announcement

Collapse
No announcement yet.

hot-backup.py on windows with python 2.5

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • hot-backup.py on windows with python 2.5

    Hello,

    I am new on this forum and I run an SVN 1.4.0 on a win server 2003.
    I would like to manage backup with the hot-backup script, but I have the following error :

    E:\SVN>hot-backup.py "E:\SVN_repos\tst_PLC" "E:\SVN_backup"
    Beginning hot backup of 'E:\SVN_repos\tst_PLC'.
    Youngest revision is 3
    Backing up repository to 'E:\SVN_backup\tst_PLC-3'...
    Traceback (most recent call last):
    File "E:\SVN\hot-backup.py", line 188, in <module>
    err_code = os.spawnl(os.P_WAIT, svnadmin, "svnadmin", "hotcopy", repo_dir, backup_subdir, "--clean-logs")
    File "C:\Python25\lib\os.py", line 604, in spawnl
    return spawnv(mode, file, args)
    OSError: [Errno 2] No such file or directory

    It will be great if someone could help me !!!

    Thanks ...

  • #2
    Hi,

    I had a similar error running SVN 1.3.0 on Windows XP.
    Originally I had an issue with the @SVNBINDIR@ variables in hot-backup.py. Another post suggested updating these to:
    svnlook = "svnlook"
    svnadmin = "svnadmin"

    Then I started seeing the same issue you have. I updated the svnadmin line to:
    svnadmin = "C:/dev/ProgramFiles/Subversion/bin/svnadmin"

    Note: make sure the delimiters are the forward slash (/).

    And now it works, except that I get the following error when creating a zip archive and it is trying to remove the working directory (the zip is created ok though).

    Archiving backup to 'c:\dev\svn\backups\VCSRepository-81-2.zip'...
    Archive created, removing backup 'c:\dev\svn\backups\VCSRepository-81-2'...
    Traceback (most recent call last):
    File "C:\dev\svn\backups\hot-backup.py", line 261, in <module>
    shutil.rmtree(backup_subdir)
    File "C:\Python25\lib\shutil.py", line 169, in rmtree
    rmtree(fullname, ignore_errors, onerror)
    File "C:\Python25\lib\shutil.py", line 174, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
    File "C:\Python25\lib\shutil.py", line 172, in rmtree
    os.remove(fullname)
    WindowsError: [Error 13] Access is denied: 'c:\\dev\\svn\\backups\\VCSRepository-81-2\\db\\format'


    Russ.

    Comment


    • #3
      I found the root cause of the problem

      Apparently, Python cannot delete files marked as read-only under Windows. At the very least, the files named "format" are read-only in Subversion 1.4. This is where the script breaks. I do not believe this would be a problem under Linux.

      I have a new version of the script that works under Windows.

      Comment


      • #4
        Re: I found the root cause of the problem

        Originally posted by wprrfan
        Apparently, Python cannot delete files marked as read-only under Windows. At the very least, the files named "format" are read-only in Subversion 1.4. This is where the script breaks. I do not believe this would be a problem under Linux.

        I have a new version of the script that works under Windows.
        Can you please post the file here so that it can benefit everyone

        Thanks in advance.
        --Mahesh

        Comment


        • #5
          Fixed version of the hot-backup.py script

          I created a new version of the hot-backup.py script that fixes the read-only file problem. My script fixes the problem differently that the new version from the subversion website. It can be found at...

          http://www.proaxis.com/~darkwing/hot-backup.py


          Chad

          Comment


          • #6
            Re: Fixed version of the hot-backup.py script

            Originally posted by wprrfan
            I created a new version of the hot-backup.py script that fixes the read-only file problem. My script fixes the problem differently that the new version from the subversion website. It can be found at...

            http://www.proaxis.com/~darkwing/hot-backup.py


            Chad
            Thanks Chad.
            --Mahesh

            Comment


            • #7
              Re: Fixed version of the hot-backup.py script

              Originally posted by Mahesh
              Originally posted by wprrfan
              I created a new version of the hot-backup.py script that fixes the read-only file problem. My script fixes the problem differently that the new version from the subversion website. It can be found at...

              http://www.proaxis.com/~darkwing/hot-backup.py


              Chad
              Thanks Chad.
              --Mahesh
              The error above is resolved after i ran the script "http://www.proaxis.com/~darkwing/hot-backup.py",but the error below occors,why? could you give me a hand, Chad thank you!!

              D:\Subersion_Installed\Repostory_subversion>hot-backup.py --archive-type=zip D:\
              Subersion_Installed\Repostory_subversion\test_dump _hotcopy D:\Subersion_Installe
              d\Repostory_subversion\bak
              Beginning hot backup of 'D:\Subersion_Installed\Repostory_subversion\test_ dump_h
              otcopy'.
              Youngest revision is 12
              Backing up repository to 'D:\Subersion_Installed\Repostory_subversion\bak\t est_d
              ump_hotcopy-12-1'...
              Done.
              Archiving backup to 'D:\Subersion_Installed\Repostory_subversion\bak\t est_dump_h
              otcopy-12-1.zip'...
              Archive created, removing backup 'D:\Subersion_Installed\Repostory_subversion\ba
              k\test_dump_hotcopy-12-1'...
              Traceback (most recent call last):
              File "D:\Subersion_Installed\Repostory_subversion\h ot-backup.py", line 244, in
              <module>
              shutil.rmtree(backup_subdir)
              File "C:\Python25\lib\shutil.py", line 169, in rmtree
              rmtree(fullname, ignore_errors, onerror)
              File "C:\Python25\lib\shutil.py", line 174, in rmtree
              onerror(os.remove, fullname, sys.exc_info())
              File "C:\Python25\lib\shutil.py", line 172, in rmtree
              os.remove(fullname)
              WindowsError: [Error 5] : 'D:\\Subersion_Installed\\Repostory_subversion\\ba k\\t
              est_dump_hotcopy-12-1\\db\\format'

              Comment


              • #8
                For me, on Windows Server 2003 R2 Enterprise x64 Edition SP2 , Chad's script does not resolve the delete read-only files problem.

                Any ideas ?

                Comment


                • #9
                  The problem could be fixed by replacing shutil.rmtree(...) with call to Window's "rmdir /s/q".

                  This could be done by adding the following function:
                  def rmdir(path):
                  subprocess.call(["cmd", "/c", "rmdir /s /q " + path])

                  Michael

                  Comment

                  Working...
                  X