Network mount backup path

Discussion in 'Installation/Configuration' started by Stelios, Oct 24, 2020.

Tags:
  1. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi,

    Assuming I've got a NFS server/share in place and the relevant entry under fstab to be auto-mounted under /var/backup.
    What does the option "Backup directory is a mount?" has to do with the above? Does it check if is mounted and if not it tries via the fstab entry?
    I've read some old posts about it but wasn't clear about its behavior.

    Thanks
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    From the manual: "Enable this option when the backup directory needs to be mounted before the backup starts. ISPConfig will then run the shell script
    /usr/local/ispconfig/server/scripts/backup_dir_mount.sh before it starts the backup process. Create that script and add the required mount commands to it. Ensure that the script is exacutable!"

    All functions are described in the manual, you can get it for a small price by becoming a HTF member or through a one time payment: https://www.howtoforge.com/download-the-ispconfig-3-manual
     
  3. Stelios

    Stelios Active Member HowtoForge Supporter

    Thanks Thom, I bought the manual but somehow missed that.
     
    Th0m likes this.
  4. Stelios

    Stelios Active Member HowtoForge Supporter

    By the way how to umount afterwards the directory when the backup finishes?
     
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You could alter the backup script for this, but there is no build in function afaik.
     
  6. Stelios

    Stelios Active Member HowtoForge Supporter

    So actually what it does is just to check if is mounted in order to avoid writing the files to the local file system. What about if the mount fail, let's say when the remote backup server is down. Does it stops & throws an error or it starts writing to the filesystem?
     
  7. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Just checked the code, a error email should be sent out.
     
  8. Stelios

    Stelios Active Member HowtoForge Supporter

    That is great to know.
    Thanks
     
    Th0m likes this.
  9. Stelios

    Stelios Active Member HowtoForge Supporter

    Where is stored the relevant log file to see why the backup mount isn't created properly.
    I've test the mount by running my /usr/local/ispconfig/server/scripts/backup_dir_mount.sh and worked fine. Then I run a manual backup and nothing is happening; no backup, no mount.
     
  10. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    As far as I can see in the code the errors are sent to you by email. But the script is not run before you do a backup, it's run by the system if you enable the function.

    If the mount is working, there is probably a different issue. Have you checked all settings for the backup?
     
  11. Stelios

    Stelios Active Member HowtoForge Supporter

    Even if I mount the remote storage manually and then run a manual backup of DB nothing is happening. Backup of DBs are not happening at all.
    On my web1 server (I've got multiple web/db servers) under:
    /usr/local/ispconfig/server/lib/mysql_clientdb.conf
    it has the localhost mysql settings.
    Should I put there the remote db server as well?
    If yes, I have to put more than 1. How is the proper syntax for that?
    At the moment it has:

    Code:
    root@web2:~# cat /usr/local/ispconfig/server/lib/mysql_clientdb.conf
    <?php
    
    $clientdb_host            = 'localhost';
    $clientdb_user            = 'root';
    $clientdb_password        = 'mypass';
     
  12. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

  13. Stelios

    Stelios Active Member HowtoForge Supporter

    It doesn't help much; here is the output:

    Code:
    root@db2:~# /usr/local/ispconfig/server/server.sh
    24.10.2020-23:50 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
    finished server.php.
    root@db2:~# ls -la /usr/local/ispconfig/server/temp/.ispconfig_lock
    ls: cannot access '/usr/local/ispconfig/server/temp/.ispconfig_lock': No such file or directory
     
  14. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Just tested it here, works fine for me.

    Are you making a backup of your database or web files? if database, is there a database connected to that web? Which folder are you checking for the backup? It should be in /var/backup/webID (replace ID with the web ID)
     
  15. Stelios

    Stelios Active Member HowtoForge Supporter

    Here is my setup:
    server1 - controlpanel
    server2 - web
    server3 - web
    server4 - db
    server5 - db
    etc
    Web files are backing up correct, no problems at all. It is only the DB backups that don't work; no errors and no files are creating either under /var/backup.
    The directory /var/backup on the DB servers is empty.
     
  16. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Have you tried running it when /var/backup is not a mount?
     
  17. Stelios

    Stelios Active Member HowtoForge Supporter

    This is very bizarre. Yes, I just tried without been mounted and nothing is happening; no error, no email, no DB backup.
     
  18. Stelios

    Stelios Active Member HowtoForge Supporter

    Further to my post, even from cli it doesn't work.
    php /usr/local/ispconfig/server/cron_debug.php --cronjob=500-backup.inc.php

    Does not show anything just "finished" but, in the backup list on user panel I just see the web files not any DB backups.
     
  19. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    That's weird. Where did you do the debugging? You should do this on the DB server, not the panel or webserver.

    That's normal, as it is queued when you click make manual backup. When running the cronjob, it will just run the items from the queue.
     
  20. Stelios

    Stelios Active Member HowtoForge Supporter

    I confirm that I run the debugging within the db server. I did also a manual back from the mysqldump just to double-check that I can write to the remote storage and all was ok.
    It just doesn't work through the GUI.
     
    Last edited: Oct 25, 2020

Share This Page