• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    FOGBackup.sh SQL server address error

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    2
    10
    2.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Neil Underwood
      last edited by

      I’m trying to run the FOGBackup.sh script, which has worked for me countless times in the past, but it’s now giving me a weird error:

      Backing up MySQL database................................mysqldump: Got error: 2005: Unknown MySQL server host '\'127.0.0.1\'' (0) when trying to connect
      Failed!
      

      I’ve tried replacing the IP with that of my server, but it’s not working. Restarted mysql, no joy. It looks like it may be passing the slashes and single quotes? I dunno. If anyone has any ideas I’m all ears. Thanks.

      Running Ubuntu 14.04

      1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott
        last edited by

        I’ll be honest, I wasn’t aware anybody even used that script. Give me a bit, probably tomorrow, and I hope I’ll have that script back to operational.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 3
        • N
          Neil Underwood
          last edited by

          LOL sorry to be the oddball! This script works great in a cron job for a quick & easy backup!

          1 Reply Last reply Reply Quote 0
          • N
            Neil Underwood
            last edited by Neil Underwood

            Hmmmm… So I got it working, kinda. I just removed the single quotes and escape characters on line 54:

            mysqldump -h"$MYSQL_HOST" -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" --allow-keywords -f $MYSQL_DATABASE > $backupdir/mysql/fog.sql
            

            That got me past the initial hurdle. The problem now seems to be NFS related (tried with -o nfsvers=3 as well). the cp -au command is reporting:

             *  * Backing up images........................................cp: failed to preserve ownership for ‘/mnt/fog_backup/images/images/lost+found’: Operation not permitted
            cp: failed to preserve ownership for ‘/mnt/fog_backup/images/images/Optiplex301064bit/d1.mbr’: Operation not permitted
            cp: failed to preserve ownership for ‘/mnt/fog_backup/images/images/Optiplex301064bit/d1p1.img’: Operation not permitted
            

            Plus, now that I’m looking at it, it’s injecting an extra “images” in the folder structure. ( I think I see why it’s doing this in lines 58, 62, and 65 )
            Anyway, that’s where I’m at. I need to get back to work, so I’ll revisit it in a bit. Maybe this helps 🙂

            Tom ElliottT 1 Reply Last reply Reply Quote 0
            • Tom ElliottT
              Tom Elliott @Neil Underwood
              last edited by

              @Neil-Underwood Likely because you would need to run as sudo user or as the user who owns the files. THat said, I’ve updated the backup script. I have NOT tested it, so please test and let me know of any issues.

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              N 1 Reply Last reply Reply Quote 0
              • N
                Neil Underwood
                last edited by

                OK so it’s working for me now. I lied about getting back to work, lol. I forgot about the no_root_squash on my NFS export. My new export looks like this:

                (rw,insecure,sync,no_subtree_check,no_root_squash)
                

                Additionally, I removed the trailing directories on lines 58, 62, and 65, so they now look like this:

                [[ -d $IMAGEDIR/ ]] && cp -auv $IMAGEDIR/ $backupdir/ || false
                errorStat $?
                echo "Done"
                dots " * Backing up snapins"
                [[ -d $SNAPINDIR/ ]] && cp -auv $SNAPINDIR/ $backupdir/ || false
                errorStat $?
                dots " * Backup up reports"
                [[ -d $REPORTDIR/ ]] && cp -auv $REPORTDIR/ $backupdir/ || false
                

                This eliminated the duplicate directory in the folder structure. I think it’s back to normal now. Not sure how or why it changed.
                Hope this was helpful.

                1 Reply Last reply Reply Quote 0
                • N
                  Neil Underwood @Tom Elliott
                  last edited by

                  @Tom-Elliott Ah, thanks for that. I’ll go grab it and check it out.

                  1 Reply Last reply Reply Quote 0
                  • N
                    Neil Underwood
                    last edited by

                    Wow, it looks like you just rewrote the entire thing. Thanks for taking the time to look into this!

                    1 Reply Last reply Reply Quote 0
                    • N
                      Neil Underwood
                      last edited by

                      So when trying to run your new backup script I’m running into an error right off the bat. I’m assuming it’s because of a version mismatch. the file “…/…/lib/common/utils.sh” does not exist on my system. I’m on version 7084.

                      Tom ElliottT 1 Reply Last reply Reply Quote 0
                      • Tom ElliottT
                        Tom Elliott @Neil Underwood
                        last edited by

                        @Neil-Underwood you need to update your tree

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post

                        163

                        Online

                        12.0k

                        Users

                        17.3k

                        Topics

                        155.2k

                        Posts
                        Copyright © 2012-2024 FOG Project