Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bor/sync.sh

Simple sync between two(or more) hosts by rsync & ssh
https://github.com/bor/sync.sh

Last synced: 11 days ago
JSON representation

Simple sync between two(or more) hosts by rsync & ssh

Awesome Lists containing this project

README

        

sync.sh

Simple sync between two(or more) hosts by rsync & ssh.
Using timestamp file for detect direction.

USAGE

. sync.rc && ./sync.sh [direction]
or
source sync.rc && ./sync.sh [direction]

where
direction - in or out, force direction if set

also this script need setup some vars in rc file
required:
SYNC_USER - username
SYNC_SERVER - hostname or ip
DIR_LOCAL - local dir
DIR_REMOTE - remote dir on server
RSYNC_FLAGS - rsync options
and optional:
SYNC_MAKE_LS_R - set defined if you want generate ls-R file

see *.rc.example files

KNOW BUGS

* Detect direction not work under FreeBSD (and maybe other *BSD),
because 'stat' has different options

TIPS & TRICKS

* Use alias (in .bashrc/.bash_profile) like:
alias sync_photo=". /path/to/sync.photo.rc && /path/to/sync.sh"