Wondering how to Exclude Files from Backups in DirectAdmin? We will help you.
As part of our Server Management Services, we assist customers with queries.
Today, let us see steps followed by our Support Techs
Exclude Files from Backups in DirectAdmin
When backing up large accounts, it can be desirable to skip certain large directories or exclude files for security reasons.
We have noticed large backups and often times, the reason is due to customers inadvertently taking backups of other backups that are stored within the user’s home directory
For example, WordPress plugin backup solutions, Softaculous backups, etc.
It is only going to inflate the size of the backup by the size of the included backup, and thus, consume more disk space.
In this article, let us discuss how to archive site files and to exclude backups files, error logs and other files not necessary for site restoration.
DirectAdmin offers the feature to prevent backups from being unnecessarily large.
Usually, path for configuration file is.
/home/$USER/.backup_exclude_paths
The format of the file must be relative to /home/$USER and should not include a “/home/$USER” prefix.
[root@server]# /usr/local/directadmin/directadmin c | grep skip
skip_hometargz_in_backups=0
skip_domains_in_backups=0
skip_imap_in_backups=0
skip_uebimiau_in_backups=0
skip_roundcube_in_backups=0
skip_databases_in_backups=0
skip_ftp_on_backup_fail=0
[root@server]#
The following setting to be set in the DirectAdmin configuration, which is indeed set by default for newer versions:
allow_backup_exclude_path=1
The following command to check and confirm that this is set:
# /usr/local/directadmin/directadmin c | grep allow_backup_exclude_path
In order to, exclude Awstats data from backups, which is located at /home/$USER/domains/domain.com/awstats. We can do so with the following to exclude all domains Awstats data for the user:
# echo “domains/*/awstats” >> /home/$USER/.backup_exclude_paths
# chown $USER. /home/$USER/.backup_exclude_paths
A handy feature of the DirectAdmin backup system is that we can exclude all files of a particular type or extension. For example, we can add the following to the .backup_exclude_paths file in order to exclude all .tar, .gz and .zip files from our backups:
*.gz
*.tar
*.zip
The path to the files do not matter as the * encompasses as possibilities.
DirectAdmin also allows to skip certain content in backups on the global level, though it is not as customizable.
Here are the options:
[root@server]# /usr/local/directadmin/directadmin c | grep skip | grep -v fail
skip_hometargz_in_backups=0
skip_domains_in_backups=0
skip_imap_in_backups=0
skip_uebimiau_in_backups=0
skip_roundcube_in_backups=0
skip_databases_in_backups=0
[root@server]#
If we like to enable any of these, set them to 1 in /usr/local/directadmin/custombuild/options.conf and restart DirectAdmin using the following command:
# service directadmin restart
Conclusion
Today, we saw how our Support EngineersExclude Files from Backups in DirectAdmin.
0 Comments