dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 56b3259e8112ff17d5d58625b547b7d9ca7ac6a4
parent 75e0180106f42f14622e9c759b3cf76d0e7a15ee
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat, 12 Sep 2020 07:29:43 -0400

cron: move to openrsync

Diffstat:
Mlib/cron.avail/cloudsync.sh | 18+++++++++---------
Mlib/cron.avail/dc_backup.sh | 2+-
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/cron.avail/cloudsync.sh b/lib/cron.avail/cloudsync.sh @@ -5,14 +5,14 @@ echo "Beginning cloud sync at `date`" -year=`date '+%Y'` -month=`date '+%m'` +year=`/bin/date '+%Y'` +month=`/bin/date '+%m'` lastrun_dir="$HOME/var/`basename $0`" lastrun_file="$lastrun_dir/lastrun" mobile_docs="$HOME/doc/mobile" notes="$HOME/doc/notes" server_fqdn="nextcloud.djmoch.org" -rsync_flags="-qu" +openrsync_flags="--rsync-path=/usr/bin/openrsync -a" if [ -d "$lastrun_dir" ] then @@ -48,7 +48,7 @@ then # Rsync from WebDAV to ~/Photos echo "Syncing Photos from NextCloud to $LOCAL_PHOTOS" [ ! -d $LOCAL_PHOTOS/$year/$month ] && mkdir -p $LOCAL_PHOTOS/$year/$month - rsync $rsync_flags /mnt/nextcloud/Photos/$year/$month/* $LOCAL_PHOTOS/$year/$month + openrsync $openrsync_flags /mnt/nextcloud/Photos/$year/$month/ $LOCAL_PHOTOS/$year/$month if [ -z "$firstrun" -a $lastrun_month -ne $month ] then # TODO: What if we're more than a month behind? @@ -56,13 +56,13 @@ then then mkdir -p $LOCAL_PHOTOS/$lastrun_year/$lastrun_month fi - rsync $rsync_flags /mnt/nextcloud/Photos/$lastrun_year/$lastrun_month/* $LOCAL_PHOTOS/$lastrun_year/$lastrun_month + openrsync $openrsync_flags /mnt/nextcloud/Photos/$lastrun_year/$lastrun_month/ $LOCAL_PHOTOS/$lastrun_year/$lastrun_month fi # Rsync from ~/Photos to NextCloud echo "Syncing Photos from $LOCAL_PHOTOS to NextCloud" [ ! -d /mnt/nextcloud/Photos/$year/$month ] && mkdir -p /mnt/nextcloud/Photos/$year/$month - rsync $rsync_flags $LOCAL_PHOTOS/$year/$month/* /mnt/nextcloud/Photos/$year/$month + openrsync $openrsync_flags $LOCAL_PHOTOS/$year/$month/ /mnt/nextcloud/Photos/$year/$month if [ -z "$firstrun" -a $lastrun_month -ne $month ] then if [ ! -d /mnt/nextcloud/Photos/$lastrun_year/$lastrun_month ] @@ -70,16 +70,16 @@ then mkdir -p /mnt/nextcloud/Photos/$lastrun_year/$lastrun_month fi # TODO: What if we're more than a month behind? - rsync $rsync_flags $LOCAL_PHOTOS/$lastrun_year/$lastrun_month/* /mnt/nextcloud/Photos/$lastrun_year/$lastrun_month + openrsync $openrsync_flags $LOCAL_PHOTOS/$lastrun_year/$lastrun_month/ /mnt/nextcloud/Photos/$lastrun_year/$lastrun_month fi # Rsync from ~/Documents/Mobile to NextCloud echo "Syncing mobile documents from $mobile_docs to NextCloud" - rsync $rsync_flags "$mobile_docs"/* /mnt/nextcloud/Documents + openrsync $openrsync_flags "$mobile_docs"/ /mnt/nextcloud/Documents # Rsync from NextCloud to ~/Documents/Mobile echo "Syncing mobile documents from NextCloud to $mobile_docs" - rsync $rsync_flags /mnt/nextcloud/Documents/* "$mobile_docs" + openrsync $openrsync_flags /mnt/nextcloud/Documents/ "$mobile_docs" # Finish by unmounting the WebDAV folder echo "Unmounting $server_fqdn" diff --git a/lib/cron.avail/dc_backup.sh b/lib/cron.avail/dc_backup.sh @@ -1,4 +1,4 @@ #!/bin/sh mount /mnt/timecapsule -rsync -aq --del danielmoch.com::backup /mnt/timecapsule/webhost.borg +openrsync -a --del danielmoch.com::backup /mnt/timecapsule/webhost.borg umount /mnt/timecapsule