backup folder does not exist

Discussion in 'General' started by craigfanman, Oct 11, 2022.

  1. craigfanman

    craigfanman Member

    hi i'm trying to figure out the backup process. im trying the 'download backup' button which is supposed to copy the backup from
    /var/backup/site.tar.gz
    to
    /var/www/site.com/backup/site.tar.gz
    however, none of my sites on any servers have the /backup folder present so this just fails
    also i cannot create this /backup folder even as root it says permission denied
    so i can workaround this by changing the code in
    server/plugins-available/backup_plugin.inc.php
    to copy the file to /private which is always present, but i wondered if there is a way to fix this properly?

    thanks
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    This works on my ISPConfig server. The "Download backup" button press creates the backup directory and copies the file there.
    Your attempt to create it manually fails since the website directory is protected against alteration with chattr setting.
     
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    as @Taleman states, the backup folder doesn't exist until after you first choose to download an existing backup.

    you say it fails, does it actually give an error? or are you assuming it's failed because it doesn't immediately create the backup folder?

    does the backup in /var/backup? is this a mounted folder? if so, is the folder actually mounted when you click the download button?
     
  4. craigfanman

    craigfanman Member

    hi ok thanks for replies. the backup folder is never created, i debugged this by reading this file
    server/plugins-available/backup_plugin.inc.php
    which has an if(file_exists(
    check for the backup folder. this doesnt exist so it skips the copy part. i cant find anywhere in the code where the create directory shld be happening, but it appears to not be being created when it should.
     
  5. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    maybe it's in
    /usr/local/ispconfig/server/lib/classes/backup.inc.php
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The if statement you refer to is for MongoDB backup only, it is not related to website backups. The backup and restore code for website backups is in the file that @nhybgtvfr mentioned.
     
  7. craigfanman

    craigfanman Member

    yeah the issue is same for files or database backups. i know its running the code in
    server/plugins-available/backup_plugin.inc.php
    because i added an else echo 'backup folder not present' and it does print that. anyway i will continue with my workarounds thanks
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    The MongoDB section you referred to is not even used for database backups, it is not used at all, it's simply an unused code fragment.

    You can easily create the backup folder, just to mention as you claimed in the first post that it's not possible. You probably just missed disabling and re-enabling immutable attribute.

    chattr -i /var/www/clients/clientX/webY
    mkdir /var/www/clients/clientX/webY/backup
    chattr +i /var/www/clients/clientX/webY
     

Share This Page