error: 'Failed to run regular backups' incorrectly checking for mounted drive

Discussion in 'Installation/Configuration' started by Magestyx, Oct 24, 2023.

  1. Magestyx

    Magestyx New Member

    This is my first go using ISPConfig and overall it's gone well, but the last lingering issue is that it refused to do the automated backups to a mounted drive via FTP. I went through tons of forum posts, etc. everything was set as it should be.
    However, under Monitor>System-Log every backup attempt resulted in the error: "Failed to run regular backups routine because failed to mount backup directory"
    I tested my mounting script in /usr/local/ispconfig/server/scripts/backup_dir_mount.sh repeatedly and it was fine.
    The odd thing was, even after the backups errored out each time, I'd check the server and the mounted ftp drive would be working at /mnt/my_ftp like it should.
    That meant that the mount script WAS working, so the error was something else.
    I finally went to the root of the situation - the mount check/error output itself - /usr/local/ispconfig/server/lib/classes/backup.inc.php line 2268.
    I commented out the contents of the mount_backup_dir check (lines 2269 & 2270), then forced run the backups again via:
    php /usr/local/ispconfig/server/cron_debug.php --cronjob=500-backup.inc.php
    Boom - the backups ran fine! There were a few chgrp, chmod and chown errors that showed during the process, but file and db backups uploaded to the remote ftp and all files I've checked so far in the backup archives have been a-ok.
    ===
    SO, the issue with the backup failing in this case was something faulty in the "public static function mount_backup_dir($server_id)" function, or more specifically, the "is_mounted($mountpoint)" function in calls in system.inc.php which calls the public function "exec_safe($cmd)".
    It should be returning true, but it's not.
    From what I can tell, the ultimate command that is doing this check via exec_safe is this: mount 2>/dev/null | grep on /mnt/my_ftp type
    running this manually returns:
    #grep: /mnt/my_ftp: Is a directory
    #grep: type: No such file or directory

    Anyhow, maybe this'll help someone else stuck on this issue. I know it's not ideal to change files like this, but backups running vs no backups is a clear choice.
    Cheers.

    ISPConfig 3.2 running on CentOS7 in a VirtualBox on Windows 10
     

Share This Page