डॉक्सDocumentationTutorialsUsing mscp for Fast File Transfers

तेज़ File Transfers के लिए mscp का उपयोग करना

कई SSH connections का उपयोग करके अपने Appbox server पर high-speed file transfers के लिए mscp (multi-threaded scp) इस्तेमाल करना सीखें।

mscp scp का multi-threaded variant है, जो एक साथ कई SSH (SFTP) connections पर files copy करता है। parallel connections का उपयोग करके यह large files और directories के transfers को काफी तेज़ बना देता है।

आवश्यकताएं

mscp इस्तेमाल करने से पहले, SFTP credentials पाने के लिए आपको अपने Appbox server पर SFTPgo install करना होगा।

Step 1: SFTPgo install करें

  1. Appbox App Store में SFTPgo app page पर जाएं
  2. SFTPgo को अपने server में जोड़ने के लिए Install पर क्लिक करें
  3. Install होने के बाद आपको connection details मिलेंगी:
    • Username: आपका SFTP username
    • Password: आपका SFTP password
    • Hostname: जैसे sftpgo.yourserver.appboxes.co
    • SFTP Port: जैसे 25557
    • FTP/FTPS Port: जैसे 25555
    • WebDav URL: WebDAV access के लिए

mscp install करना

अपने operating system के लिए installation method चुनें:

macOS

brew install upa/tap/mscp

MacPorts से

sudo port install mscp

Ubuntu / Debian

sudo add-apt-repository ppa:upaa/mscp
sudo apt-get update
sudo apt-get install mscp

RHEL / Fedora / CentOS / Rocky Linux / AlmaLinux

sudo dnf copr enable upaaa/mscp
sudo dnf install mscp

Windows

mscp के native Windows binaries नहीं हैं, लेकिन आप इसे WSL (Windows Subsystem for Linux) के जरिए इस्तेमाल कर सकते हैं:

Step 1: WSL install करें

PowerShell को Administrator के रूप में खोलें और चलाएं:

wsl --install

prompt आने पर computer restart करें।

Step 2: WSL में mscp install करें

WSL set up होने के बाद (Ubuntu default है), WSL terminal खोलें और चलाएं:

sudo add-apt-repository ppa:upaa/mscp
sudo apt-get update
sudo apt-get install mscp

Source से build करना

अगर आपके system के लिए packages उपलब्ध नहीं हैं, तो आप source से mscp build कर सकते हैं:

# Clone the repository
git clone https://github.com/upa/mscp.git
cd mscp
 
# Prepare patched libssh
git submodule update --init
patch -d libssh -p1 < patch/$(git -C libssh describe).patch
 
# Install build dependencies
bash ./scripts/install-build-deps.sh
 
# Build
mkdir build && cd build
cmake ..
make
 
# Install
sudo make install

बुनियादी उपयोग

mscp syntax scp जैसी है। यहां common usage patterns दिए गए हैं।

अपने Server पर File upload करें

# -P specifies the SFTP port (use your SFTP port from SFTPgo settings)
mscp -P 25557 localfile.zip username@sftpgo.yourserver.appboxes.co:/path/to/destination/

Directory upload करें

scp के विपरीत, directories के लिए mscp को -r flag की जरूरत नहीं होती:

# -P 25557 is the SFTP port from your SFTPgo Options
mscp -P 25557 /local/directory username@sftpgo.yourserver.appboxes.co:/remote/path/

अपने Server से File download करें

# Replace 25557 with your actual SFTP port
mscp -P 25557 username@sftpgo.yourserver.appboxes.co:/remote/file.zip /local/destination/

Directory download करें

mscp -P 25557 username@sftpgo.yourserver.appboxes.co:/remote/directory/ /local/path/

Advanced Options

Multiple Connections इस्तेमाल करना

Default रूप से mscp multiple connections इस्तेमाल करता है। आप -n से connections की संख्या specify कर सकते हैं:

mscp -P 25557 -n 8 largefile.zip username@sftpgo.yourserver.appboxes.co:/destination/

Failed Transfers resume करें (Checkpointing)

mscp interrupted transfers resume करने के लिए checkpointing support करता है:

# Enable checkpointing
mscp -P 25557 -C /path/to/checkpoint.json largefile.zip username@server:/destination/
 
# Resume a failed transfer
mscp -P 25557 -C /path/to/checkpoint.json -r

SSH Key Authentication specify करें

अगर आपने SFTPgo के साथ SSH key authentication set up किया है:

mscp -P 25557 -i ~/.ssh/your_key localfile.zip username@sftpgo.yourserver.appboxes.co:/destination/

Bandwidth limit करें

transfer bandwidth limit करने के लिए (shared connections पर useful):

mscp -P 25557 -l 10M localfile.zip username@sftpgo.yourserver.appboxes.co:/destination/

Example: Complete Workflow

Appbox से मिले SFTPgo credentials इस्तेमाल करते हुए complete example:

# Set your credentials (replace with your actual values from SFTPgo Options)
HOST="sftpgo.yourserver.appboxes.co"  # Your Hostname
PORT="25557"                           # Your SFTP Port (not FTP port!)
USER="your_username"                   # Your Username
 
# Upload a large file using 4 connections
mscp -P $PORT -n 4 ~/Downloads/large-backup.tar.gz $USER@$HOST:/backups/
 
# Upload an entire directory
mscp -P $PORT ~/Projects/my-website/ $USER@$HOST:/www/
 
# Download files from server
mscp -P $PORT $USER@$HOST:/media/movies/ ~/Downloads/movies/

Performance Tips

  1. Large files के लिए अधिक connections इस्तेमाल करें: large file transfers के लिए -n value बढ़ाएं (जैसे -n 8 या -n 16)
  2. कई small files के लिए कम connections इस्तेमाल करें: बहुत सारी small files वाली directories के लिए fewer connections अधिक efficient हो सकते हैं
  3. Text files के लिए compression enable करें: mscp SSH compression inherit करता है; text-heavy transfers के लिए -C इस्तेमाल करें
  4. बहुत large transfers के लिए checkpointing इस्तेमाल करें: multi-gigabyte transfers में interruption होने पर resume कर सकें, इसलिए checkpointing हमेशा enable करें

Troubleshooting

Connection Refused

सुनिश्चित करें कि आप SFTPgo settings का correct SFTP port इस्तेमाल कर रहे हैं (FTP port नहीं):

mscp -P 25557 ...  # Use your actual SFTP port

Permission Denied

Verify करें कि आपका username और password correct हैं। आप पहले standard SFTP client से test कर सकते हैं:

sftp -P 25557 username@sftpgo.yourserver.appboxes.co

Slow Transfers

parallel connections की संख्या adjust करके देखें:

mscp -P 25557 -n 16 ...  # Increase connections

Additional Resources