We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5274
    • 177 Posts
    I put together a simple web site backup script that can be accessed via a MODx module or run as a standalone script. It can be set up to dump from 0 to 10 MySQL databases. It is very much like the modbak script that has been offered in the repository. I’m a novice at PHP and not the best at documentation so I was wondering if somebody could give it a test drive and provide feedback. I’ve been using a version of this for the last few months and it works for me. The real test is if it works for others. I have it available on my site here: http://go4it2day.com/news14.html

    If it’s of benefit I’ll submit it to the MODx repository. I hope this helps some of the good folks in the MODx community!

    EDIT: Version 1.2 has been tested with Windows so I changed the topic title...
      • 4310
      • 2,310 Posts
      Looks promising, any instructions on installing?
        • 5274
        • 177 Posts
        Quote from: bunk58 at May 20, 2008, 02:46 AM

        Looks promising, any instructions on installing?

        I put some installation steps in the README file. Documentation is not one of my passions!
          • 4310
          • 2,310 Posts
          Oops, missed that I’ll get my reading glasses on!
            • 14254
            • 35 Posts
            Is it possible to exclude a directory from the backup?

            The snippet keeps crashing when it gets to a directory with some .pswd files because it can open the files to read them.

            I need to keep those files, so I was curious if there were an easy way to exclude the directory that is causing the problem?

            Thanks. I really like this and think it shows a lot of promise.

            JK
              • 5274
              • 177 Posts
              Quote from: jknupp at May 21, 2008, 03:31 PM

              Is it possible to exclude a directory from the backup?

              Excluding directories is not something I build into the scripts but its definately a good suggestion. I’m a bit confused as to why the .pswd file is causing problems. Do you get specific error codes or can you provide server log entries for trouble shooting?
                • 14254
                • 35 Posts
                Here’s what I get in the output window of the module:

                Backup in process...

                Start MySQL backup of `ksracing_modx` to backup/tmp/`ksracing_modx`.sql . . . Completed MySQL backup. - Size: 626692

                Start ListDir of all file names to /home/content/k/s/r/ksracing01/html/backup/tmp/listdir.txt . . . Completed ListDir. - Size: 225212

                Start PclZip archive of all files to /home/content/k/s/r/ksracing01/html/archive/ksRacing_bkup.zip . . . Error: PCLZIP_ERR_READ_OPEN_FAIL (-2) : Unable to open file ’/home/content/k/s/r/ksracing01/html/stats/.statspwd’ in binary read mode


                At this point the whole process dies.

                I can check on server logs if it would help.

                Justin
                  • 5274
                  • 177 Posts
                  Quote from: jknupp at May 21, 2008, 05:53 PM
                  . . . Error: PCLZIP_ERR_READ_OPEN_FAIL (-2) : Unable to open file ’/home/content/k/s/r/ksracing01/html/stats/.statspwd’ in binary read mode[/i]

                  Out of curiosity, what are the file permissions of the offending file? Any chance they are less than 0400? (I’m wondering if they are not readable?)

                  EDIT: I was able to duplicate the error on my system by turning off the read file permissions to a single file. All files must have read permission set to on otherwise the zip class blows up as you found out..
                    • 5274
                    • 177 Posts
                    I’ve released BkupMODx v1.2 which is available here: http://go4it2day.com/news15.html

                    I was able to load up XAMPP 1.6.6a on a W2K VMWare guest which enabled me to test Windows with PHP4 and PHP5. A few modifications and the scripts run just fine now on both Windows and Linux with either PHP4 or PHP5. Score!

                    If a few more folks can test drive this I think it’s nearly ready for the MODx Resource area.
                      • 14254
                      • 35 Posts
                      The permissions on the file in question are 604.

                      Owner has read,write
                      Group has nothing
                      Public has read.

                      Could this be the problem. Unfortunately I can’t change the permissions. This site is hosted with Godaddy, and they don’t allow you to change anything in this directory.

                      Thanks!