https://github.com/anupsarkar-dev/.net-ssh-sftp-file-sync
https://github.com/anupsarkar-dev/.net-ssh-sftp-file-sync
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anupsarkar-dev/.net-ssh-sftp-file-sync
- Owner: anupsarkar-dev
- Created: 2022-04-30T16:47:48.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-02T19:28:47.000Z (about 4 years ago)
- Last Synced: 2025-01-13T12:24:27.784Z (over 1 year ago)
- Language: C#
- Size: 8.12 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Remote SSH/SFTP
##### Features
- Every 1 minute service connects to sftp and checks if there are new or modified files.
- Service downloads and syncs all the new files to local path.
- If remote file modified, same local file also gets updated.
- All file and directory info is stored in Datatabse (postgresql).
- EF core code first migration used.
- Project developed using Service oriented architecture (Repository pattern, Unit of work).
- Solution is divided with foud sub projects, such as Web, Core, Domain & Infrasruction.
- For background job , Hangfire is used
- For Logging, Serilog is used.
- SSH server is configurable from AppSettings.json
### Database Migration
For database context and migration , refer to project MediaFon.FileManager.Infrastructure.
` cd MediaFon.FileManager.Infrastructure`
#### Apply Migration
` dotnet ef database update`
### App Settings
Change SFTP Server configuration from appsetting.json
```
{
"SSH_Settings": {
"SFTP_SERVER": "192.168.0.109",
"SFTP_USER": "root",
"SFTP_PASS": "Password",
"SFTP_PORT": 22,
"UserDefinedRemoteWorkingDirectory": "/C:/SFTP", // Starting forward slash before 'C:/' is required
"BackgroundJobInterval": 1,
"LocalFileStoreLocation": "LocalFileStorage" // Folder should be within the Web Application directory
}
}
```
### Start Application
MediaFon.FileManager.Web is the start up project to run the application.
### Api Enpoints URL
#### https://localhost:7193/swagger/index.html
### Background Jobs Realtime Dashboard
#### https://localhost:7193/hangfire