Skip to content
Simplistic rsync-based filesystem synchronization utility
Branch: master
Clone or download
Latest commit 48e8906 Apr 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
dircopy Add missing files Apr 11, 2019
fpsync Add missing files Apr 11, 2019
fpsyncrc.excludes Updates Apr 11, 2019
fpsyncrc.py
syncme Add missing files Apr 11, 2019

README.md

fpsync

Simplistic rsync-based filesystem synchronization utility.

WARNING: While I use these tools every single day and have done so for nearly 20 years, they are destructive, have no error checking, can and will eat your entire home directory if misused.

There's a core rsync wrapper that does all the low-level work, dircopy, and it's called by two other "everyday" tools:

  • fpsync: meant to keep a whole home directory in sync between multiple computers, listing all subdirs and files to sync and exclusion patterns.

  • syncme: meant to sync a single directory (the current one) between two computers.

For convenience, I call this via a utility wrapper in bash and in most cases, a couple of shorthand aliases. Modify the below to suit your needs and put it into your .bashrc:

# Convenience fpsync wrapper with message, wait and timing
function hsync {
    local host=${1:-"longs"}
    local mode=${2:-"sync"}

    if [[ "$mode" == "up" ]]; then
        echo "*** Destructive upload to: $host"
    elif [[ "$mode" == "down" ]]; then
        echo "*** Destructive download from: $host"
    else
        echo "*** Two-way sync with: $host"
    fi
    echo "*** Sleeping for 2 seconds..."
    sleep 2
    time fpsync --host $host $mode

}

# Sync with longs (my server, configured in my .ssh/config file)
alias longssync-up='hsync longs up'
alias longssync-down='hsync longs down'
You can’t perform that action at this time.