Skip to content

Commit 51b1f7c

Browse files
authored
use-dedibackup-ftp-backup: Adding Linux example
1 parent e46caa0 commit 51b1f7c

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

dedibox/dedicated-servers/how-to/use-dedibackup-ftp-backup.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,37 @@ ABOR, ACCT, APPE, CDUP, CWD, DELE, FEAT, LIST, MDTM, MKD, MODE, NLIST, NOOP, PAS
101101
In case of a failure during authentication (wrong identifier and/or password), connection failure of the access control list (ACL), or failure of the automatic login from an unauthorized IP, the connection will be systematically terminated with the message **421 Service not available**.
102102

103103

104+
### Usage on Linux
105+
106+
- `lftp` is working well with this FTP server.
107+
- `curl` is not working properly since some commands are not fully handled by this FTP server and `curl` handles those FTP commands internally.
108+
It is why `lftp` is the best option.
109+
110+
Usage example with `lftp` that can be integrated in automated script:
111+
```sh
112+
# Requirement
113+
apt install lftp
114+
115+
# FTP Credentials
116+
FTP_HOST="dedibackup-dc3.online.net"
117+
FTP_USER="auto" # If using ACL and auto-login, login is 'auto', else use provided username
118+
FTP_PASS="" # If using ACL and auto-login, password is empty, else use provided password
119+
120+
# - Connect to FTP server
121+
# - Upload a file, list files, remove a file
122+
# - Disconnect from FTP server
123+
lftp -u "$FTP_USER,$FTP_PASS" "$FTP_HOST" <<EOF
124+
# Enable passive mode for FTP
125+
set ftp:passive-mode true
126+
# Change to the specified FTP directory
127+
cd "/"
128+
# Upload a file
129+
put "dedibox_file_path_here.7z"
130+
# List files in the folder
131+
ls
132+
# Remove a file
133+
rm "ftp_file_path_here.7z"
134+
# Exit lftp
135+
bye
136+
EOF
137+
```

0 commit comments

Comments
 (0)