{"id":21275232,"url":"https://github.com/wickedsoda/folder-sync-csharp","last_synced_at":"2025-03-15T13:12:45.035Z","repository":{"id":252409827,"uuid":"840349944","full_name":"WickedSoda/Folder-Sync-CSharp","owner":"WickedSoda","description":"C# app for one-way folder sync with periodic updates. ","archived":false,"fork":false,"pushed_at":"2024-09-03T20:47:12.000Z","size":107,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-21T09:35:23.646Z","etag":null,"topics":["command-line","csharp","folder-synchronization"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WickedSoda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-09T14:01:24.000Z","updated_at":"2024-09-03T20:47:16.000Z","dependencies_parsed_at":"2024-08-09T18:58:19.939Z","dependency_job_id":"a408ac83-0849-4ae2-8e47-56009de70207","html_url":"https://github.com/WickedSoda/Folder-Sync-CSharp","commit_stats":null,"previous_names":["wickedsoda/folder-sync-csharp","danielsvscodes/folder-sync-csharp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WickedSoda%2FFolder-Sync-CSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WickedSoda%2FFolder-Sync-CSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WickedSoda%2FFolder-Sync-CSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WickedSoda%2FFolder-Sync-CSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WickedSoda","download_url":"https://codeload.github.com/WickedSoda/Folder-Sync-CSharp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235054724,"owners_count":18928626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","csharp","folder-synchronization"],"created_at":"2024-11-21T09:28:36.013Z","updated_at":"2025-01-22T03:21:31.468Z","avatar_url":"https://github.com/WickedSoda.png","language":"C#","readme":"# Folder Sync\n\n## Overview\n\nFolder Sync is a C# command-line application designed to synchronize two directories: a source directory and a replica directory. The tool ensures that the replica directory mirrors the content of the source directory by periodically copying, updating, or deleting files as needed. Synchronization is one-way, meaning changes are only propagated from the source to the replica.\n\n## Technologies Used\n\n- **C#**: The core programming language used for developing the application.\n- **.NET SDK (version 5.0 or later)**: Framework for building and running the application.\n- **Command-Line Interface (CLI)**: For providing user input and configuration.\n- **Built-in .NET Libraries**: Used for file system operations and logging.\n\n## How It Works\n\nFolder Sync performs one-way synchronization between a source and a replica directory:\n\n- **One-way Synchronization**: The replica folder is updated to exactly match the content of the source folder.\n- **Periodic Synchronization**: Synchronization occurs periodically at intervals specified by the user.\n- **Logging**: All file operations (creation, copying, and deletion) are logged to both a file and the console.\n- **Command-line Configuration**: Folder paths, synchronization intervals, and log file paths are provided via command-line arguments.\n- **Directory Creation Prompt**: If the specified source or replica directory does not exist, the user is prompted to create it.\n- **No Third-party Libraries**: The synchronization logic is implemented using .NET's built-in libraries.\n\n## Project Structure\n\n```plaintext\nFolder-Sync/\n├── DirSyncTool/\n│   ├── Models/\n│   │   └── SyncOptions.cs\n│   ├── Services/\n│   │   ├── SyncService.cs\n│   │   └── LoggingService.cs\n│   ├── Utils/\n│   │   └── FileUtils.cs\n│   └── Program.cs\n├── bin/\n├── obj/\n├── LICENSE\n├── README.md\n└── FolderSync.sln\n```\n\n## Prerequisites\n\n- **.NET SDK (version 5.0 or later)**: Make sure the .NET SDK is installed and available in your system PATH.\n- **Operating System**: Windows, macOS, or Linux.\n\n## Getting Started\n\n### Step 1: Clone the Repository\n\n```bash\ngit clone https://github.com/DanielsvsCodes/Folder-Sync-CSharp.git\ncd Folder-Sync\n```\n\n### Step 2: Build the Project\n\nBuild the project using the .NET CLI:\n\n```bash\ndotnet build\n```\n\n### Step 3: Running the Application\n\nRun the application from the command line by specifying the source directory, replica directory, synchronization interval (in seconds), and log file path:\n\n```bash\ndotnet run -- \"\u003csourcePath\u003e\" \"\u003creplicaPath\u003e\" \u003cintervalInSeconds\u003e \"\u003clogFilePath\u003e\"\n```\n\nExample:\n\n```bash\ndotnet run -- \"..\\SourceFolder\" \"..\\ReplicaFolder\" 30 \"..\\sync.log\"\n```\n\n- +\u003csourcePath\u003e+: The path to the source directory.\n- +\u003creplicaPath\u003e+: The path to the replica directory.\n- +\u003cintervalInSeconds\u003e+: The synchronization interval in seconds (e.g., 60 for every 60 seconds).\n- +\u003clogFilePath\u003e+: The path to the log file where operations are recorded.\n\n### Step 4: Handling Non-Existent Directories\n\nIf the specified source or replica directory does not exist, the program will prompt you to create it:\n\n```plaintext\nSource directory 'C:\\Invalid\\SourcePath' does not exist. Would you like to create it? (y/n):\n```\n\n- If you type `y`, the directory will be created, and the program will proceed.\n- If you type `n`, the program will exit, as the directory is required for synchronization.\n\n### Step 5: Stopping the Application\n\nThe application will continue running, performing synchronization at the specified interval. To stop the application, press `[CTRL] + C` in the terminal where the application is running.\n\n## Logging\n\nAll operations, such as file copying, updating, and deleting, are logged to both the console and the specified log file. The log file provides a history of synchronization operations, which can be useful for troubleshooting.\n\n## Troubleshooting\n\n- **Application Exits Immediately**: Ensure that the paths are correctly specified and that the interval is set appropriately. The application should remain running until you manually stop it.\n- **No Files Are Copied**: Ensure that the source directory contains files and that the paths are accessible. Also, ensure that the interval is set correctly.\n- **Log File Not Created**: Ensure that the log file path is valid and that the application has write permissions for the specified directory.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwickedsoda%2Ffolder-sync-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwickedsoda%2Ffolder-sync-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwickedsoda%2Ffolder-sync-csharp/lists"}