We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    Hello,

    I would like to ask if anyone here knows of any good scripts that can backup my files and databases on my hosting account. There’s no auto-function with my host to have my sites backedup and then saved in a zip in a separate folder. My host said I could create a script myself and run it but I’m unsure which would be the best way to do this so I thought I would ask on here since there’s some experts that could probably answer this for me. I don’t mind if there were 2 scripts, 1 for saving files and the other saving the DB if 1 script couldn’t do both. I can backup my site using my host’s backup system but this only allows me to download the files to my pc and I would prefer they were stored in a directory in my account, obviously out of the public html folder.

    Any suggestions would be great. Thanks
      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 4310
      • 2,310 Posts
      Ross,
      Have a look here, could be what you’re looking for.
        • 25551 ☆ A M B ☆
        • 1,231 Posts
        Thanks Bunk, looks like just what I need.

        Just tried it out... worked perfectly! Is there a way to have it run once a day automatically?
          Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
          AugmentBLU - MODX Partner

          BLUcart - MODX Revolution E-Commerce & Shopping Cart
          • 5274
          • 177 Posts
          Quote from: rossco at May 29, 2008, 04:38 AM

          Is there a way to have it run once a day automatically?

          Yes if you can setup a cron job in *nix or task scheduler in windows it can be run automatically. You would modify and call the index.php file in your external scripts.
            • 25551 ☆ A M B ☆
            • 1,231 Posts
            I’m using servers with Linux on them and in the control panel there’s a scheduled tasks area. According to the help it’s says to set up a command to run the script.

            Not being very savvy with this could someone be kind enough to give me an idea of what to do? There’s one line where a command line is put in and here’s a copy of the instructions. As I have the backup script in my public_html folder I’m not sure how it would work.

            Configure Scheduled Tasks

            The command lines below will be run on the web server for you at the intervals you select. Please note that the path is absolute so if your script is called test.pl and is located in your public_html/ directory then the full path would be:-

            /home/sites/rossco-designs.com/public_html/test.pl.

            Programs that use excessive server resources may be banned. We take this opportunity to remind you that we do not allow permanent server processors to be run on our servers.
            Common Problems

            Please note the following common problems you may experience when setting up a scheduled task:

            * Please make sure you enter a valid date for your tasks.
            * The file permissions for the script are set correctly, 711 or 755.
            * If the script involves code from a scripting language specify the path for the interpreter used e.g. for perl /usr/bin/perl and php is /usr/bin/php otherwise the shell will not know how to interpret the script.
            * If the script being run is adapted from a cgi script be sure to make the necessary changes as the scheduled task is run by the shell statement such as #!/usr/bin/perl which is needed for cgi, and will be interpreted as a comment.


            Thanks for the help.
              Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
              AugmentBLU - MODX Partner

              BLUcart - MODX Revolution E-Commerce & Shopping Cart
              • 5274
              • 177 Posts
              Quote from: rossco at May 29, 2008, 09:22 AM
              ...As I have the backup script in my public_html folder I’m not sure how it would work.

              ...The command lines below will be run on the web server for you at the intervals you select. Please note that the path is absolute so if your script is called test.pl and is located in your public_html/ directory then the full path would be:-

              /home/sites/rossco-designs.com/public_html/test.pl.
              ...

              If you took the default installation then your command line would read:

              /home/sites/rossco-designs.com/public_html/backup/index.php

              Don’t forget to modify the $base_path value in the index.php to read:

              /home/sites/rossco-designs.com/public_html/

              The $bkup_dir value in the index.php is already setup for the default installation:

              backup/

              Based on your post that should get you started. Good luck!
                • 25551 ☆ A M B ☆
                • 1,231 Posts
                Hey,

                Has anyone had problems running this script at all? On one of my sites it works great but is only about 40mb in size but one size that has about 500mb of information, stops at the SQL backup line.

                Is there limitations to this script?
                  Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                  AugmentBLU - MODX Partner

                  BLUcart - MODX Revolution E-Commerce & Shopping Cart
                  • 25551 ☆ A M B ☆
                  • 1,231 Posts
                  Thanks Ganesh,

                  I just looked at the thread for the script and there’s an update... also looking at the config there’s a setting for the size of the backup.

                  Ross
                    Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                    AugmentBLU - MODX Partner

                    BLUcart - MODX Revolution E-Commerce & Shopping Cart