2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30
2025-05-07 20:02:10 +05:30

SSHFileToCbs - File Transfer Application

A modern Python implementation of a file transfer application between local and remote servers using SSH/SFTP or FTP.

Features

  • Support for both SSH/SFTP and FTP protocols
  • Robust logging with rotation
  • System monitoring for performance and resource usage
  • Error handling and recovery
  • Configurable file paths and patterns
  • Clean code architecture following modern Python practices

Requirements

  • Python 3.6+
  • Dependencies listed in requirements.txt

Installation

  1. Clone the repository
  2. Install dependencies:
pip install -r requirements.txt

Configuration

Create or edit the config/config.ini file with your server details and file paths:

[server]
REMOTE_HOST=your_host
REMOTE_USER=your_username
REMOTE_PASS=your_password
REMOTE_PORT=22

[app]
SLEEP_TIME_MINS=30
TRANSFER_PROTOCOL=SSH

[paths]
LOCAL_FOLDER_PATH=/path/to/local/files/
ARCHIVE_FOLDER_PATH=/path/to/archive/
LOCAL_REPORT_PATH=/path/to/report/files/
LOCAL_FAILED_PATH=/path/to/failed/files/

[remote_paths]
REMOTE_REPORT_PATTERN=BLK_*
REMOTE_INPUT_FILE_PATH=path/to/input/
REMOTE_OUTPUT_FILE_PATH=path/to/output/
REMOTE_FAILURE_FILE_PATH=path/to/failure/

Usage

Run the application with:

python main.py

Command Line Options

  • --config: Path to configuration file (default: config/config.ini)
  • --log-level: Set logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)

How It Works

The application:

  1. Sends local files to the remote server
  2. Archives sent files locally
  3. Fetches report files from the remote server
  4. Fetches failed files from the remote server
  5. Sleeps for a configured period
  6. Repeats the cycle

Architecture

  • protocols/: Protocol interfaces and implementations (SSH, FTP)
  • services/: Core services for file sending and fetching
  • file_operations/: Local file management utilities
  • utils/: Logging, configuration, and monitoring utilities
  • app.py: Main application class
  • main.py: Entry point and command-line interface
Description
No description provided
Readme 46 KiB
Languages
Python 100%