Effortlessly synchronize your local and remote directories with style!
Welcome to FileSyncer—your friendly neighborhood script for synchronizing files between local and remote directories over SFTP. Whether you're dealing with large media files or keeping codebases in sync, FileSyncer has got your back.
Say goodbye to manual transfers and hello to automated synchronization with a touch of elegance and a sprinkle of fun! 🌟
- Two-Way Synchronization: Compare and sync files between local and remote directories.
- File Matching: Use patterns to match specific files.
- Case-Insensitive Matching: Ignore case differences in filenames.
- Extension Filtering: Sync only the file types you care about (e.g.,
.mkv
,.mp4
). - Interactive Mode: Get prompts before overwriting files.
- Progress Indicators: Enjoy real-time progress bars during file transfers.
- Logging: Keep track of what's happening with adjustable log levels.
- Multi-Threaded Performance: Utilize multiple threads for faster synchronization when not in interactive mode.
First, ensure you have Python 3.6+ installed. Then, clone the repository and install the required packages:
git clone https://github.com/yourusername/filesyncer.git
cd filesyncer
pip install -r requirements.txt
Run the script using Python:
python filesync.py [options]
Synchronize files between your local and remote directories:
python filesync.py \
--local-dir "/path/to/local/dir" \
--remote-dir "/path/to/remote/dir" \
--hostname "your.remote.host" \
--username "your_username" \
--key-filename "/path/to/ssh/key" \
--index-dir "/path/to/index/dir"
Enable interactive mode to get prompts before overwriting files:
--interactive
Match files containing a specific substring:
--match "Episode.S02E05"
Ignore case differences in filenames:
--ignore-case
Filter files by extensions:
--type mkv,mp4,avi
Adjust the maximum number of worker threads:
--max-workers 16
Set the logging level:
--log-level DEBUG
Force index rebuild by setting update interval to zero:
--update-interval 0
Example 1: Basic Sync
python filesync.py \
--local-dir "/home/user/videos" \
--remote-dir "/remote/videos" \
--hostname "remote.host.com" \
--username "user" \
--key-filename "/home/user/.ssh/id_rsa" \
--index-dir "/home/user/.filesyncer"
Example 2: Interactive Sync with File Matching
python filesync.py \
--local-dir "/home/user/videos" \
--remote-dir "/remote/videos" \
--hostname "remote.host.com" \
--username "user" \
--key-filename "/home/user/.ssh/id_rsa" \
--index-dir "/home/user/.filesyncer" \
--interactive \
--match "Finale" \
--ignore-case \
--type mkv,mp4 \
--log-level INFO
Example 3: High-Performance Sync
python filesync.py \
--local-dir "/data/local" \
--remote-dir "/data/remote" \
--hostname "remote.host.com" \
--username "user" \
--key-filename "/home/user/.ssh/id_rsa" \
--index-dir "/home/user/.filesyncer" \
--max-workers 32 \
--log-level WARNING
Contributions are welcome! Feel free to submit a pull request or open an issue.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/awesome-feature
- Commit your changes:
git commit -am 'Add an awesome feature'
- Push to the branch:
git push origin feature/awesome-feature
- Open a pull request.
Give a ⭐ if this project helped you! Let's make file synchronization fun and easy together! 🎉
Happy Syncing!