A simple bash script that continuously synchronizes directories using rsync.
- Continuous directory synchronization
- Supports both local and remote directories
- Automatic SSH connection management
- Configurable polling interval
- Clone or download this repository
- Make the script executable:
chmod +x rsync-poll.sh
- Add to your PATH by adding this line to your
~/.bashrcor~/.zshrc:export PATH="$PATH:/path/to/rsync-poll"
- Reload your shell configuration:
source ~/.bashrc # or source ~/.zshrc
rsync-poll.sh <source_dir> <destination_dir>Local synchronization:
rsync-poll.sh ~/Documents/project ~/Backup/projectRemote synchronization:
rsync-poll.sh ~/local/folder user@remote:/path/to/folder
rsync-poll.sh user@remote:/path/to/folder ~/local/folderThe default polling interval is 2 seconds. To modify this, edit the INTERVAL variable in the script.