This project implements a simple folder synchronization tool that copies files from a source folder to a backup folder at specified intervals. It also logs actions and errors using Serilog.
- Periodic synchronization of files from a source folder to a backup folder.
- Logging of actions and errors using Serilog.
- Automatically creates directories if they don’t exist.
- Configurable synchronization interval.
- Graceful shutdown on user input.
- Validates source, backup, and log paths.
- NuGet packages:
- Serilog
- Serilog.Sinks.File
- Serilog.Sinks.Console
- Command-line interface
- File system access
-s or --source <path>: Path to the source folder-b or --backup <path>: Path to the backup folder-l or --log <path>: Path to the log folder (file will be created inside this folder)-i or --interval <seconds>: Synchronization interval in seconds
- Clone the repository
git clone https://github.com/Jurgee/Veeam-Test-task.git- Navigate to the project directory
cd FolderSync- Build the application
dotnet build- Run the application
dotnet run -- -s <source_path> -b <backup_path> -l <log_path> -i <interval_in_seconds>dotnet run -- -s "C:\SourceFolder" -b "C:\BackupFolder" -l "C:\Logs" -i 60Logs will be written to the specified log file and also output to the console. The log will include information about synchronization actions and any errors encountered.
Press Ctrl+C to stop the synchronization process gracefully.
- Serilog: A diagnostic logging library for .NET applications.
- CommandLineParser : A library for parsing command line arguments.
- System.Timers : A timer that raises an event at user-defined intervals.