Error during Backup Creation, FTP information invalid

Zelda

Verified User
Joined
Jan 27, 2020
Messages
17
Hello guys, after trying for more than 3 days, with the help of ChatGPT I guess I need help from the real experts.
  1. I have two versions of DirectAdmin (one will be migrated to the other one soon).
  2. I use back-up via SFTP on the DirectAdmin setup version 1.668, this works fine
  3. I try to setup back-up via exact same information for DirectAdmin setup 1.680
  4. This gives me the error: Error during Backup Creation, FTP information invalid
These images are from the back-up on server 1 (which works), versus server 2 below (which is NOT working):


Things i've tried:
  1. I'm using HiDrive
  2. Tried command line: sftp sftp.hidrive.strato.com ✅
  3. Tried to create OpenSSH key and connect without password via command line ✅
  4. Disabled CSF (csf -x) and tried again to connect via DirectAdmin admin backup ❌
ChatGPT suggestions:
Code:
[root@transip admin]# echo "action=backup&local_path=admin" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d2000
2025/07/29 15:40:27  info executing task            task=action=backup&local_path=admin
2025/07/29 15:40:27  info finished task             duration=735.345µs task=action=backup&local_path=admin
2025/07/29 15:40:27 error task failed               error=unknown backup type "" task=action=backup&local_path=admin

This is driving me crazy for weeks now and today I tried again with new energy but still failing to get back-ups working.

I tried reading some threads here but they are very old or using FTPS instead of SFTP.
 
Last edited:
Allright strange that it does work on my other VPS. I made a custom script now:
Step 1:

Create SSH key for your back-up server (im using HiDrive of Strato):

Code:
ssh-keygen -t ed25519 -C "hidrive-server" -f /root/.ssh/hidrive

This will create:

  • Private key: /root/.ssh/hidrive
  • Public key: /root/.ssh/hidrive.pub

When prompted for a passphrase: leave it empty for automation, then press Enter.

Display the public key:

Code:
cat /root/.ssh/hidrive.pub
Copy the entire line and paste it into your HiDrive SSH settings panel under:

Settings > Access > SSH Keys

Wait 1–2 minutes for activation.

Code:
vi /root/.ssh/config

Add:

Code:
Host sftp.hidrive.strato.com
    HostName sftp.hidrive.strato.com
    User store-XXXX
    IdentityFile /root/.ssh/hidrive
    IdentitiesOnly yes

Now you can test:

Code:
sftp sftp.hidrive.strato.com

This script:
  • Backs up all users (/home/USERNAME + matching databases)
  • Archives are named:
  • user.admin.<username>.tar.gz
  • Uploads to HiDrive and overwrites existing files
  • Deletes local archive and temp folders after upload

Start with:

Code:
vi /root/da-backup-all.sh
Paste this code:

Code:
#!/bin/bash

# === CONFIG ===
BACKUP_DIR="/root/da_backups"
REMOTE_USER="store-XXXX"
REMOTE_HOST="sftp.hidrive.strato.com"
REMOTE_PATH="/users/store-XXXX"
SSH_KEY="/root/.ssh/hidrive"
MYSQL_CNF="--defaults-extra-file=/usr/local/directadmin/conf/my.cnf"

# === PREP ===
mkdir -p "$BACKUP_DIR"

# === GET USER LIST ===
USER_LIST=$(ls /usr/local/directadmin/data/users)

echo "[+] Starting backup for all DirectAdmin users..."

for USER in $USER_LIST; do
    echo "[>] Backing up user: $USER"

    TMP_DIR="${BACKUP_DIR}/tmp-${USER}"
    mkdir -p "$TMP_DIR/mysql"

    # Dump user's databases
    DBS=$(mysql $MYSQL_CNF -e "SHOW DATABASES LIKE '${USER}\\_%';" | grep "${USER}_")
    for DB in $DBS; do
        echo "    - Dumping DB: $DB"
        mysqldump $MYSQL_CNF "$DB" > "$TMP_DIR/mysql/${DB}.sql"
    done

    # Copy home directory
    cp -a "/home/$USER" "$TMP_DIR/home"

    # Create archive
    ARCHIVE="${BACKUP_DIR}/user.admin.${USER}.tar.gz"
    tar -czf "$ARCHIVE" -C "$TMP_DIR" .

    # Upload to HiDrive
    echo "    - Uploading to HiDrive: $ARCHIVE"
    sftp -i "$SSH_KEY" ${REMOTE_USER}@${REMOTE_HOST} <<EOF
cd ${REMOTE_PATH}
put -f ${ARCHIVE}
bye
EOF

    # Cleanup
    rm -rf "$TMP_DIR"
    rm -f "$ARCHIVE"

    echo "✔ Backup done for $USER"
done

echo "[+] All backups completed and cleaned."

Code:
chmod +x /root/da-backup-all.sh

Run it:

Code:
/root/da-backup-all.sh

Or make cronjob to do so every night at 3am:

Code:
0 3 * * * /root/da-backup-all.sh >> /var/log/da-backup.log 2>&1
 
Back
Top