#!/bin/bash
# /usr/local/bin/sync000
# http://crystalfaeries.net/posix/bin/sync000
# celeste:crystalfaery 2016-06-30 20:11:05+00:00
# Invoking user must have necessary access rights to user mounted (cifs and/or sshfs) partitions.
# (note that root may be unable to access a partition mounted by a user)
# Invoking user must have in place an active ssh-agent to manage key-based login to other hosts.
# IFF the keys are not password protected then invocation from CRON via crontab entries may work.
# (otherwise user will be driven crazy entering their pasword umpty-gazillion times)
# INTEGRATE:
# /usr/local/bin/synchronize.sh was the bash script used to invoke synchronize family of sync scripts:
# /usr/local/bin/syncup is the bash script used to invoke synchronize family of sync scripts:
# /usr/bin/sudo /usr/bin/touch /var/log/syncup.log && \
# /usr/bin/sudo /bin/chmod 640 /var/log/syncup.log && \
# whowasi=`/usr/bin/whoami` && \
# /usr/bin/sudo /bin/chown "$whowasi": /var/log/syncup.log && \
# eval `/usr/bin/ssh-agent` && \
# /usr/bin/ssh-add && \
# /usr/bin/nice /usr/bin/ionice -c 3 \
# /bin/run-parts --report /usr/local/bin/synchronize/ >> /var/log/syncup.log 2>&1 && \
# Deactivating a sync script is done by not symlinking to it from this directory (remove symlink).
# Active sync scripts are symlinked in the folder /usr/local/bin/synchronize/ e.g.:
# lrwxrwxrwx 1 celeste staff 10 Jan 25 11:33 sync000 -> ../sync000*
# lrwxrwxrwx 1 celeste staff 16 Feb 17 09:47 syncbookmarks -> ../syncbookmarks*
# lrwxrwxrwx 1 celeste staff 16 Feb 19 08:53 syncdocuments -> ../syncdocuments*
# lrwxrwxrwx 1 celeste staff 12 Mar 6 23:29 syncemail -> ../syncemail*
# lrwxrwxrwx 1 celeste staff 10 Jan 25 11:34 synczzz -> ../synczzz*
echo "`now` ======= $0 ======= $1 ======= SYNCHRONIZE"
syntax highlighted by Code2HTML, v. 0.9.1