Advanced Backup Path Customization, ZSTD Compression, and Backup Management in DirectAdmin

DirectAdmin provides powerful tools for customizing backup paths, enabling ZSTD compression, skipping specific directories, and using custom scripts to rename or relocate backup files. This article explains how to use custom append paths, strftime formatting, retention strategies, compression settings, skip lists, and post-backup hooks to build a fully optimized backup workflow.

DirectAdmin BackupCustom Append PathZSTD Compression

~3 min read · Updated Feb 27, 2026

1. Custom Append Path for Backup Locations


DirectAdmin allows administrators to customize backup paths using custom append values. This feature enables flexible retention strategies by dynamically generating folder names based on time formats.


1.1 Examples of Custom Append Path Usage


Daily Backups – No Append:


Backups overwrite daily, retaining only the most recent backup.


Daily Backups – Append: Weekday


Each backup is stored in a folder named after the weekday, creating a 7‑day retention cycle.


Weekly Backups – Append: Week Number


One backup per week, retaining 4 backups (one per week of the month).


Monthly Backups – Append: Month


One backup per month, retaining 12 backups per year.


Daily Backups – Append: Full Date


Retains all backups indefinitely. This may fill the disk unless combined with a cron job to delete older backups.


1.2 Using strftime for Custom Paths


The append path uses strftime formatting to generate folder names. Examples:


  • %F → 2014‑03‑05
  • %A → Wednesday
  • %B → March
  • %m/%d → 03/28

Allowed characters:


  • a‑z
  • A‑Z
  • 0‑9
  • % / - . _

Disallowed characters in the final path:


  • :
  • ,
  • % (if produced in output)

Path generator tool:


http://strftime.net

1.3 Important Warning About Unsafe Paths


Dynamic paths must remain inside skipped backup directories to avoid recursive backups.


Safe example:


/home/admin/admin_backups/Wednesday

Unsafe example:


/home/admin/admin_backups_Wednesday

This may cause infinite recursive backups.


2. Enabling ZSTD Compression for Backups


DirectAdmin supports tar.zst compression, which is significantly faster and more efficient than gzip.


Enable ZSTD:


da config-set zstd 1
da config-set backup_gzip 2
systemctl restart directadmin

3. Which Folders Are Skipped During Backup?


To avoid loops and unnecessary data, DirectAdmin skips the following directories inside /home/USERNAME:


  • backups
  • user_backups
  • admin_backups
  • usr
  • bin
  • etc
  • lib
  • lib64
  • tmp
  • var
  • sbin
  • dev

3.1 Skipping Custom Paths


You can skip additional folders using:


Per‑User:


/usr/local/directadmin/data/users/USERNAME/skip_backup_home_files.list

Global:


/usr/local/directadmin/data/admin/skip_backup_home_files.list

Valid examples:


  • Maildir
  • application_backups

Invalid example:


  • some/specific/path.txt

4. Adding a Date to Backup Filenames


To rename backups from:


user.admin.username.tar.gz


to:


user.admin.username.2024‑10‑15‑23‑32.tar.gz


Create this script:


#!/bin/sh
RESELLER=admin
BACKUP_PATH=`echo $file | cut -d/ -f1,2,3,4`
REQUIRED_PATH=/home/$RESELLER/admin_backups

if [ "$BACKUP_PATH" = "$REQUIRED_PATH" ]; then
   if [ "`echo $file | cut -d. -f4,5`" = "tar.gz" ]; then
       NEW_FILE=`echo $file | cut -d. -f1,2,3`.`date +%F-%H-%M`.tar.gz
       if [ -s "$file" ] && [ ! -e "$NEW_FILE" ]; then
           mv $file $NEW_FILE
       fi
   fi
fi
exit 0;

Make executable:


chmod 755 /usr/local/directadmin/scripts/custom/user_backup_success/dated_backup.sh

5. Moving Local Backups to an External Mount


If an external mount is writable only by root, DirectAdmin cannot write backups directly to it. The solution is to create backups locally and move them afterward.


Create this script:


#!/bin/bash
FROM=/home/admin/admin_backups
TO=/mnt/backups/
if [[ "${file}" == ${FROM}* ]]; then
    /bin/mv -f ${file} ${TO}
fi
exit 0;

Make executable:


chmod 755 /usr/local/directadmin/scripts/custom/user_backup_success/move_backups.sh

This script runs only when the backup completes successfully.


Written & researched by Dr. Shahin Siami

Related Articles

Email Client Configuration & Dovecot Quota/Monitoring Guide for DirectAdmin Users

This guide explains how to configure popular email clients (iPhone Mail, Thunderbird, Gmail POP/SMTP), enable Dovecot LMTP quota warnings, and check the last login time for all email accounts on a DirectAdmin server. It includes step by step instructions, recommended IMAP/SMTP settings, and useful administrative scripts.

Continue

Troubleshooting Dovecot in DirectAdmin – Fixing IMAP Errors, Authentication Issues, and SSL Certificate Checks

Dovecot is the IMAP/POP3 server used by DirectAdmin. Sometimes users encounter errors such as “Connection dropped by IMAP server” or “unknown user” during authentication. This guide explains how to fix corrupted Dovecot indexes, understand authentication logs, hide unnecessary warnings, and manually inspect SSL certificates on IMAP ports 143 and 993.

Continue

DNS Troubleshooting in DirectAdmin – When named is Running but Domains Do Not Resolve

Sometimes the named (BIND) service runs normally, yet DNS queries fail or domains do not resolve from outside. This guide provides a complete troubleshooting workflow for checking named listeners, firewall rules, named.conf configuration, DNS propagation issues, subdomain problems, resolv.conf errors, and common Apache/Nginx misconfigurations.

Continue

Managing DNS Records in DirectAdmin – Complete Practical Guide for Administrators

DirectAdmin provides a powerful DNS management system that allows administrators to control TTL values, create SRV records, enable DNSSEC, manage subdomain delegation, automate TLSA records, and perform mass DNS updates. This guide explains all essential DNS operations in DirectAdmin with real-world examples and best practices.

Continue

DNS and Nameservers in DirectAdmin – Complete, Practical, and Professional Guide

DNS is the backbone of the internet, responsible for translating domain names into IP addresses. DirectAdmin allows you to create private nameservers (ns1/ns2), manage DNS zones, configure DNS clustering, use external DNS, and troubleshoot common issues. This guide provides a complete, clear, and practical explanation of DNS concepts and their implementation in DirectAdmin.

Continue

CustomBuild in DirectAdmin – Complete Guide to Installation, Updates, Configuration, and Advanced Customization

CustomBuild is DirectAdmin’s primary software management system. It installs, updates, configures, and rebuilds essential services such as Apache, Nginx, PHP, MariaDB/MySQL, Exim, Dovecot, FTP servers, and more. Because most components are compiled from source, CustomBuild offers exceptional flexibility, fast access to new versions, and optimized performance.

Continue