{"id":48832747,"url":"https://github.com/mathieumarthy/sync-files-to-cloud","last_synced_at":"2026-04-14T21:03:46.369Z","repository":{"id":319897794,"uuid":"1075330635","full_name":"MathieuMarthy/sync-files-to-cloud","owner":"MathieuMarthy","description":"Automatically sync local folders to cloud storage (Google Drive, OneDrive, Dropbox) with scheduled uploads \u0026 file compression. 🐢","archived":false,"fork":false,"pushed_at":"2026-03-22T11:32:35.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-23T02:59:03.184Z","etag":null,"topics":["cloud-backup","cloud-storage","google-drive","python","synchronization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MathieuMarthy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-13T10:59:25.000Z","updated_at":"2026-03-22T11:30:32.000Z","dependencies_parsed_at":"2025-10-20T20:44:06.049Z","dependency_job_id":null,"html_url":"https://github.com/MathieuMarthy/sync-files-to-cloud","commit_stats":null,"previous_names":["mathieumarthy/sync-files-to-cloud"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/MathieuMarthy/sync-files-to-cloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuMarthy%2Fsync-files-to-cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuMarthy%2Fsync-files-to-cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuMarthy%2Fsync-files-to-cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuMarthy%2Fsync-files-to-cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MathieuMarthy","download_url":"https://codeload.github.com/MathieuMarthy/sync-files-to-cloud/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuMarthy%2Fsync-files-to-cloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31815083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cloud-backup","cloud-storage","google-drive","python","synchronization"],"created_at":"2026-04-14T21:03:45.823Z","updated_at":"2026-04-14T21:03:46.357Z","avatar_url":"https://github.com/MathieuMarthy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sync Files to Cloud 🐢\n\nA Python-based application that automatically synchronizes local folders to cloud storage providers on a scheduled\nbasis.\n\n## Features\n\n- **Automatic Synchronization**: Schedule periodic uploads of local folders to cloud storage\n- **Multiple Folders**: Configure multiple folders with different sync intervals and settings\n- **File Compression**: Optionally compress files before uploading to save storage space\n- **Exclude Patterns**: Define patterns to exclude specific files or folders from sync\n- **Desktop Notifications**: Get notified when reconnection to cloud provider is needed\n- **Logging**: Comprehensive logging system to track all sync operations\n\n## Supported Cloud Providers\n\n| Provider     | Status         | Documentation                                           |\n|--------------|----------------|---------------------------------------------------------|\n| Google Drive | ✅ Available   | [Setup Guide](documentation/connect-to-google-drive.md) |\n| Git          | 🛠️ In progress | -                                                       |\n| OneDrive     | 🔜 Coming Soon | -                                                       |\n| Dropbox      | 🔜 Coming Soon | -                                                       |\n\n## Installation\n\n1. Prerequisites\n\n- Python 3.8 or higher\n\n\u003cbr\u003e\n\n2. Get the code:\n\n**Option A: Clone the repository**\n\n```bash\ngit clone \u003crepository-url\u003e\ncd sync-files-to-cloud\n```\n\n**Option B: Download from releases**\n\n- Go to the [Releases page](https://github.com/MathieuMarthy/sync-files-to-cloud/releases)\n- Download the latest release (Source code.zip or Source code.tar.gz)\n- Extract the archive and navigate to the folder\n\n\u003cbr\u003e\n\n3. Create and activate a virtual environment:\n\n```bash\n# Create virtual environment\npython -m venv venv\n```\n\n\n4. Activate virtual environment\n#### On Windows:\n```powershell\nvenv\\Scripts\\activate\n```\n#### On macOS/Linux:\n```bash\nsource venv/bin/activate\n```\n\n5. Install required dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\n6. Set up cloud provider credentials:\n    - For Google Drive: Follow the [Google Drive Setup Guide](documentation/connect-to-google-drive.md)\n    - Place your `gdrive_credentials.json` file in the `credentials/` folder\n\n## Configuration\n\nEdit the `config.yaml` file to configure your synchronization settings:\n\n```yaml\nlogging:\n  level: \"INFO\"\n  file_path: \"app.log\"\n\nsync:\n  - name: my_images\n    cloud_provider: \"GoogleDrive\"\n    sync_interval: 60  # in minutes\n    compress: true\n    local_path: \"C:/Users/Username/Documents/Images\" # Absolute path to local folder. Can be a string or a list of strings\n    remote_path: \"/images\"\n    exclude_patterns: # work like a .gitignore file\n      - \"*.tmp\"\n      - \"temp_folder/*\"\n```\n\nOther exemple with multiple local paths and exclude patterns:\n\n```yaml\nlocal_path:\n  - \"/home/user/.config\"\n  - \"/home/user/.oh-my-zsh\"\n\nexclude_patterns:\n  - \"*\"\n  - \"!neofetch\"\n  - \"!kitty\"\n  - \"!custom/themes\"\n  - \"!nvim\"\n```\n\n### Configuration Options\n\n- **name**: Unique identifier for the sync folder\n- **cloud_provider**: Cloud storage provider (currently only \"GoogleDrive\")\n- **sync_interval**: Time between syncs in seconds\n- **compress**: Whether to compress files into a zip archive before upload\n- **local_path**: Absolute path to the local folder to sync\n- **remote_path**: Destination path in the cloud storage\n- **exclude_patterns**: List of patterns to exclude files (supports wildcards like `*.tmp`, `folder/*`)\n\n⚠️ If you change the configuration while the application is running, you need to restart it to apply the changes.  \n*See the 'usage' section for commands to restart the application depending on your OS.*\n\n## Usage\n\nRun the application:\n\n```bash\npython main.py\n```\n\nThe application will:\n\n1. Initialize connections to configured cloud providers\n2. Perform an initial sync for all configured folders\n3. Schedule periodic syncs based on the configured intervals\n4. Continue running until stopped (Ctrl+C)\n\n### Running at Startup\n\nTo automatically run the script when your computer starts:\n\n\u003cdetails\u003e\n\u003csummary\u003eWindows Instructions\u003c/summary\u003e\n\n1. Setup the powershell script\n\nGo in the `/scripts` folder, open `activate-scheduled-task.ps1`and edit the line 3:\n\n```powershell\n$projectPath = \"path to the project\" # Put the absolute path to this project\n```\n\n2. Run the script as administrator\n\nopen a powershell terminal as administator and run\n\n```powershell\npath/to/activate-scheduled-task.ps1\n```\n\n⚠️ *If you have issues running the script due to execution policies, you can right-click on the script → Properties →\nUnblock → Apply. Then try running it again.*\n\n\u003cbr\u003e\n\n#### To deactivate the scheduled task\n\nyou can run the deactivation script `scripts\\remove-scheduled-task.ps1`\n\n#### To restart the application\n\nyou can run the restart script `scripts\\restart-scheduled-task.ps1`\n\n#### Start the application through the Task Scheduler\n\n```powershell\nStart-ScheduledTask -TaskName \"Sync-files-task\"\n```\n\n#### Stop the application through the Task Scheduler\n\n```powershell\nStop-ScheduledTask -TaskName \"Sync-files-task\"\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eLinux Instructions (systemd)\u003c/summary\u003e\n\n1. Create a systemd service file `/etc/systemd/system/sync-files.service`:\n\ndon't forget to replace the paths and username\n\n```ini\n[Unit]\nDescription = Sync Files to Cloud\nAfter = network.target\n\n[Service]\n; replace the paths below with the project path\nExecStart = /path/to/sync-files-to-cloud/venv/bin/python /path/to/sync-files-to-cloud/main.py\nWorkingDirectory = /path/to/sync-files-to-cloud\n; Replace 'your-username' with the appropriate user\nUser = your-username\nRestart = on-failure\n\n[Install]\nWantedBy = multi-user.target\n```\n\n2. Enable and start the service:\n\n```bash\nsudo systemctl enable sync-files.service\nsudo systemctl start sync-files.service\n```\n\n\u003cbr\u003e\n\n#### Deactivate the service\n\nTo stop and disable the service:\n\n```bash\nsudo systemctl stop sync-files.service\nsudo systemctl disable sync-files.service\n```\n\n#### Restart the application\n\nTo restart the service:\n\n```bash\nsudo systemctl restart sync-files.service\n```\n\n\u003c/details\u003e\n\n## How It Works\n\n1. **Configuration Loading**: The application reads `config.yaml` to load sync parameters\n2. **Cloud Authentication**: Connects to cloud providers using credentials from the `credentials/` folder\n3. **File Discovery**: Scans local folders and filters files based on exclude patterns\n4. **Compression** (optional): Compresses files into a zip archive\n5. **Upload**: Uploads files to the cloud provider while preserving folder structure\n6. **Scheduling**: Repeats the process at configured intervals\n7. **Error Handling**: If connection fails, sends desktop notification to reconnect\n\n## Troubleshooting\n\n### Files Not Syncing\n\n- Check that the local path exists and is accessible\n- Verify exclude patterns are not blocking desired files\n- Review logs in `app.log` for detailed error messages\n\n## Contributing\n\nContributions are welcome! Please feel free to submit pull requests or open issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieumarthy%2Fsync-files-to-cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieumarthy%2Fsync-files-to-cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieumarthy%2Fsync-files-to-cloud/lists"}