A bash-based rsync helper for syncing local and remote sites.
- Clone this repository -or- just copy the
sole-sync.sh
script to your local machine. - Make the file executable
chmod +x sole-sync.sh
- If the file is not in a location that exists in your bash paths, we suggest making a symbolic link from a location that typically is:
cd /usr/local/bin/ && ln -s <path_to_your_script>/sole-sync.sh sole-sync.sh
- Create an bash alias for it:
- Run:
nano ~/.bash_profile
- Add this to your bash_profile:
alias sole-sync="sole-sync.sh"
- Run:
source ~/.bash_profile
- Run:
- 👏🏼 - Thats the global setup. You can now run
sole-sync [options]
from anywhere.
From any of your local website project directories, you can create sync-exclude
or sync-preset
files. The ones mentioned here are loaded by default if they exist or aren't specified via command options override.
Default preset:
- copy
sync-preset-example
tosync-preset
and put your default credentials in. - The default preset is loaded well, by default. run
sole-sync [options]
Alternate preset(s):
- copy
sync-preset-example
tosync-preset-staging
and put your staging credentials in. - to use the staging preset, run:
sole-sync --preset sync-preset-staging [options]
- copy
sync-exclude-example
tosync-exclude
- Modify this as needed to ensure you aren't syncing files / folders you don't want to or should be.
- Just like presets, you can create and specify more than default as desired, i.e.
sync-preset-staging
sole-sync --exclude sync-exclude-staging
- If you don't want to remember that everytime, you can just add the following to the preset file to remeber that preset uses a separate exclude file:
exclude=sync-exclude-staging
- Documentation:
sole-sync --help
- Tip: We suggest that
path
andsrc
always contain trailing slashes