Bobcares

Exclude Files from Backups in DirectAdmin – How to perform

by | May 10, 2021

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.

 

Are you using Docker based apps?

There are proven ways to get even more out of your Docker containers! Let us help you.

Spend your time in growing business and we will take care of Docker Infrastructure for you.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF