#!/bin/bash
#                       /usr/local/bin/crons
# https://crystalfaeries.net/posix/bin/crons
# celeste:crystalfaery CRONS 2020-03-15 16:20:31+00:00
# edit locally the master .crontab files
# for both local laptop and remote server
# then install the new crontabs to activate them
# file naming convention: .crontab.hostname (or abbreviation)

# make sure we have the latest file from the remote server
# just in case we edited it there via SSH login:
rsync -auvH `my_twin`:~/.crontab.blue ~

# edit the crontabs
vi .cron*

# upload the new server crontab (and backup local one):
rsync -auvH .cron* `my_twin`:~

# install the remote server crontab
ssh -t `my_twin` 'crontab .crontab.blue'

# install the local crontab
crontab .crontab.fey

exit	$?	# return the results of the remote server
