Error Compressing the backup file user.xentrhost.hundekjori.tar.gz : /bin/tar: /path: Cannot open: Permission denied

Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"

Top Level » DirectAdmin » Backup & Restore Process

Error Compressing the backup file user.xentrhost.hundekjori.tar.gz : /bin/tar: /path: Cannot open: Permission deniedLast Modified: Nov 11, 2013, 10:23 pm
If you see an error similar to the following:

Error Compressing the backup file user.reseller.user.tar.gz : /bin/tar: domains/ Cannot open: Permission denied
/bin/tar: Error exit delayed from previous errors

where the listed files are not readable by the User, the issue is likely related to the way the strict backup permissions work.

With the strict backup permissions enabled (which they are by default), backups are run as the User.
This means any file that are not readable by the User (eg: apache owned files) must be accounted for in a different manner.
The way DA does this is by figuring out which files are not readable prior to the backup, copying them to a different location (with User ownership) and backing them up that way.  The issue is that if you have a system the creates/modifies files on a regular basis, it's possible that the apache owned files are created after DA has done the check, but before the backup is actually created, giving you the error.

There are several different solutions for the issue:

1) Use a php system that runs php scripts as the User, and not apache.  These include suPhp, fastcgi, php-fpm, or mod_ruid2+CLI.
Note that php CLI without mod_ruid2 is where php runs as "apache", which is likely what you're already using, giving you this error.

2) Quick/easy option, without changing the php system is to ignore the new files if they cannot be read:

3) The last resort is to disable the strict backup permissions, but this is less secure.

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST