Code Monkey home page Code Monkey logo

da-sftp-backups's Introduction

Directadmin

Description

A set of patched scripts to allow Directadmin to

  • store
  • list
  • download

backups over SSH using SFTP.

Author of patches

Alex Grebenschikov, Poralix, (www.poralix.com), 2018-2023

Version

History of versions

  • Version: 0.1.poralix $ Tue Jan 30 12:43:50 +07 2018
  • Version: 1.2.poralix $ Thu Sep 12 23:55:18 +07 2019: Updated per changes in https://www.directadmin.com/features.php?id=2488
  • Version: 1.2.poralix.2 $ Wed Dec 11 20:30:29 +07 2019: Recursive creation of FTP folders on remote server
  • Version: 1.2.poralix.3 $ Thu Dec 7 18:54:17 +07 2023: ZST support added

Requirements

For Debian servers:

apt-get install sshpass

For CentOS:

yum install sshpass

Installation

cd /usr/local/directadmin/scripts/custom/
git clone https://github.com/poralix/directadmin-sftp-backups.git
cp -f directadmin-sftp-backups/ftp_download.php ./
cp -f directadmin-sftp-backups/ftp_list.php ./
cp -f directadmin-sftp-backups/ftp_upload.php ./
chmod 700 ftp_*.php
chown diradmin:diradmin ftp_*.php

Usage

Go to directadmin Admin login -> Admin Backup/Transfer and set:

  • Username: real ssh username
  • Password: real ssh password or full to SSH RSA key
  • Remote Path: full path to a backup directory from a remote server
  • Port: 22

The script will detect the specified port 22 and will use SFTP to connect to SSH port. If you want FTP/FTPS just change port to 21 and update other credentials (the same script can be used for FTP/FTPS/SSH/SFTP).

If you run sFTP, SSH on a different port modify the scripts and your port to the line:

SSH_PORTS="22 2200 22022";

The line exists in all 3 files:

  • ftp_download.php
  • ftp_list.php
  • ftp_upload.php

Backup files in DirectAdmin might be named in the following formats depending on settings:

Without encryption:

  • zstd=1 & backup_gzip=2 & encryption=0 => admin.root.admin.tar.zst
  • zstd=0 & backup_gzip=1 & encryption=0 => admin.root.admin.tar.gz
  • zstd=0 & backup_gzip=0 & encryption=0 => admin.root.admin.tar

With encryption:

  • zstd=1 & backup_gzip=2 & encryption=1 => admin.root.admin.tar.zst.enc
  • zstd=0 & backup_gzip=1 & encryption=1 => admin.root.admin.tar.gz.enc
  • zstd=0 & backup_gzip=0 & encryption=1 => admin.root.admin.tar.enc

da-sftp-backups's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.