#!/bin/sh cd ~ || exit fsync () { rsync -RUuavn --delete-after $exclude $syncfile "$target" printf "===commit these changes?\n" printf "y/n: " read -r uinput if [ "$uinput" != "n" ] && [ "$uinput" != "N" ]; then printf "\n\n\n" rsync -RUuav --progress --delete-after $exclude $syncfile "$target" printf "\n===end sync\n---------\n\n" fi } syncfile="stuff/scripts" target="/mnts/flash/backup" exclude="--exclude target/* --exclude node_modules/* --exclude thumbnails/* --exclude 4dm/* --exclude /nwjs.*" fsync