Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I ISPConfig 3
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 553
    • Issues 553
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 45
    • Merge requests 45
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #3567
Closed
Open
Created May 16, 2015 by Timo Boldt@timo.boldt

backup - delete unused file (interval = none)

It seems as if the daily cron got some problems. If you configure ispconfig to create backups owned by root, the directory structure looks like:

root@srv1 /usr/local/ispconfig/server # ls -lha /var/backup drwxr-x--- 2 web1 client1 4,0K Mai 16 14:56 web1 root@srv1 /usr/local/ispconfig/server # ls -lha /var/backup/web1/ -rwxr-x--- 1 root root 44K Mai 16 14:56 web1_2015-05-16_14-56.tar.gz

Alright, but now you choose your backup interval to none, so the daily_cron will try to delete theese files:

exec('sudo -u '.escapeshellarg($web_user).' rm -f '.escapeshellarg($web_backup_dir.'/')); --> sudo -u web1 rm -f '/var/backup/web1/'

The problem will be first, that /var/backup is owned by root:root by 750 (no access by web1)... If you fix the permissions (755), next time it will be reset:

if(isset($server_config['backup_dir_ftpread']) && $server_config['backup_dir_ftpread'] == 'y') {
    $backup_dir_permissions = 0755;
} else {
    $backup_dir_permissions = 0750;
}

So we need to differentiate 2 cases:

if only accessable by root , sudo should be not used, if by user, sudo -u usage.

Another solution is to set 755 without 2 cases, but I think it would be better to use sudo as prefix , if user access is configured.

Assignee
Assign to
Time tracking