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