We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30585
    • 833 Posts
    I'm not sure if it's only me, but there's something very confusing in the docs about How to Use the Databackup snippet.

    I'm supposed to follow these steps to get it working, but...

    1. Install via the package manager (Done)
    2. Set the databackup folder setting to something that is behind your web root. The default is core/components/databackup/dumps/ (Done)
    3. Set the purge time option (databackup.pruge) if you want this to be different, the default is 1814400, which is 21 days. (Done)
    4. Set up Cron Manager: http://rtfm.modx.com/display/ADDON/CronManager and then Create a new job. (Done)
    5. Select the backup snippet and then select in minutes how often you would like this to run. Every 24 hours is 1440 minutes. (Done)

    The part I don't get is how to get the bloody thing to work sad!!!!??? The manual gives an example of a simple backup of "your site every 24 hours" with the following getCache call

    [[!getCache?
    &element=`backup`
    &excludeTables=`my_custom_table,my_other_custom_table`
     
    &cacheExpires=`86400`
    ]]


    But Where do I place this call?

    It also says that there's a sample backupMany snippet included and there is one. But where do I use it?

    Am I missing something?

    This question has been answered by treigh. See the first response.

      A MODx Fanatic
      • 30585
      • 833 Posts
      Anyone?
        A MODx Fanatic
        • 6038
        • 228 Posts
        Hi Treigh,
        If you followed all the steps for setting it up to run through CronManager, then you don't need to add the 'backup every 24hrs' snippet.

        First, check in the backup folder you specified: core/components/databackup/dumps/
        Have any backups been created there? If not, then you need to go back to checking your CronManager is running correctly.

        Visit the CronManager in the components section of the manager, and right click on your cron to view logs
        They should tell you if the cron is executing the databackup snippet or not
        You might have to go back further to make sure your cronmanager implementation on the server is also producing a result.
        Can you change your cron output on the server to send an email with the processing results to you?
          • 30585
          • 833 Posts
          Thanks Christian. For one I forgot to activate the cron job in component manager. No logs generated yet though. I'll give it time and see what I get overnight. Thanks for the insight.
            A MODx Fanatic
          • discuss.answer
            • 30585
            • 833 Posts
            It's working!

            For anyone following this saga, here's how I got it to work:


            • Complete all setup steps mentioned above

            • Set the cron job active status to 'Yes' in Components > Cron Manager

            • Specify the data Folder in the snippet property to a folder above the site root (e.g. dataFolder:/Path/to/Home_Directory/Backup_Folder/). It's strongly advised for security reasons.

            • set the assets/components/cronmanager/cron.php file permission to 755. It was initially set to 604 and I was getting a 401 error when reading the file from a browser and the Databackup snippet wasn't working until the file permission was changed.

            For those on shared hosting, setting up a cron job is fairly simple. The tricky part was to specify the command and I used the following:

            /usr/bin/curl -o /Path/to/Home_Directory/Backup_Folder/cron_result.txt http://yourdomain.com/assets/components/cronmanager/cron.php 


            The cron_result.txt part simply outputs the results to a text file. I set this because I was getting a
            curl: no URL specified!
            error in the report email.

            I hope someone will find this helpful.
              A MODx Fanatic
              • 16430
              • 217 Posts
              Well I dont have a problem with working, problem is that id doesnt purge my old backup, so I have already 600 MB of backups on my FTP. databackup.pruge is set to 600000, path is also correct...(default)
                • 3749
                • 24,544 Posts
                I wonder if that's a typo in the docs. Try databackup.purge instead.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 6038
                  • 228 Posts
                  christianhanvey Reply #8, 13 years ago
                  Quote from: BobRay at Sep 06, 2013, 06:38 PM
                  I wonder if that's a typo in the docs. Try databackup.purge instead.

                  no, it's not a typo—that's the correct name for the property :/
                    • 3749
                    • 24,544 Posts
                    Quote from: christianhanvey at Sep 09, 2013, 09:13 PM
                    Quote from: BobRay at Sep 06, 2013, 06:38 PM
                    I wonder if that's a typo in the docs. Try databackup.purge instead.

                    no, it's not a typo—that's the correct name for the property :/

                    Not according to Github: wink

                    https://github.com/jgulledge19/DataBackup/blob/master/_build/data/databackup/transport.settings.php

                    $settings['databackup.purge']= $modx->newObject('modSystemSetting');
                    $settings['databackup.purge']->fromArray(array (
                        'key' => 'databackup.purge',
                        'value' => '1814400',
                        'xtype' => 'textfield',
                        'namespace' => 'databackup',
                        'area' => 'File System',
                    ), '', true, true);



                    https://github.com/jgulledge19/DataBackup/blob/master/core/components/databackup/elements/snippets/snippet.backup.php

                    if (empty($purge)) $purge = $modx->getOption('databackup.purge', null, 1814400);
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 16430
                      • 217 Posts
                      It is my typo... Correct key is indeed databackup.purge