Git Product home page Git Product logo

ftp-sync-service's Introduction

FTP Sync Service

Simple Windows service to sync new files from a targeted directory to an FTP server.

Build and publish

Run build command in the repository root folder, to build the app.

dotnet build FtpSyncService.sln --configuration Release

Run publish command

dotnet publish -o publish

  • Creates publish folder in the repository root folder.

Run application

It is possible to run the app executable or dll via dotnet command

publish\FtpSyncService.exe {{arguments}} {{options}}

dotnet publish\FtpSyncService.dll {{arguments}} {{options}}

Note: Run empty command to get the standard help

Arguments

  1. Local Path - Local full folder path to watch.
  2. Remote path - Remote relative folder path to upload.

Options

General:

  • FilterPattern (-f, --filter) - Extension filter pattern [default: *.*]
  • Clean (-c, --clean) - Delete files after upload [default: true]
  • SyncDelayMiliseconds (-d, --delay) - Sync delay (in ms) after file created event [default: 1000]

Ftp:

  • Host (-h, --host) - Ftp server host address
  • Port (-t, --port) - Ftp server port [default: 21]
  • User (-u, --user) - Ftp server user name
  • Password (-p, --password) - Ftp server password

Example

Parametrized:

FtpSyncService.exe {local-path} {remote-path} --filter {filter-expression} --host {host-address} --user {user} --password {password}

Real:

FtpSyncService.exe %USERPROFILE%\Downloads DownloadsBackup --filter *.* --host 127.0.0.1 --user user --password 123456

Note: Filter supports wildcards, e.g. --filter *.txt to sync all .txt files.

Create Windows service

Use Service Controller (sc.exe) tool to manage Windows Services

Run create command to add application as Windows Service

sc.exe create "Ftp Sync Service" binPath= "{publish-folder}\FtpSyncService.exe {local-path} {remote-path} --filter {filter-expression} --host {host-address} --user {user} --password {password}" start= delayed-auto

Note: Once created, service may be manually started or operating system need to be restarted

Run delete command to remove the Windows Service, after it has been stopped

sc.exe delete "Ftp Sync Service"

Logging

Use Event Viewer tool to get the logs from the Ftp Sync Service service.

  • Source: Ftp Sync Service - use Source to filter logs from this service only

ftp-sync-service's People

Contributors

darjanbogdan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.