dotfiles

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

commit f2b0baac6a0a65118bc1fdda1cbef323fc0b535b
parent b5409969bad9d34e6e9d9378ae82e8d57253f9e5
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sun,  7 Jan 2018 11:23:14 -0500

Use xdg-user-dir for photosync

Diffstat:
M.config/cron/photosync.sh | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/.config/cron/photosync.sh b/.config/cron/photosync.sh @@ -11,6 +11,13 @@ else exit -1 fi +if type -p xdg-user-dir > /dev/null 2>&1 +then + LOCAL_FOLDER=`xdg-user-dir PICTURES` +else + LOCAL_FOLDER="$HOME/Pictures" +fi + # Mount the WebDAV folder and set so only we can read it if mount /mnt/nextcloud > /dev/null 2>&1 then @@ -19,8 +26,8 @@ then # Rsync from WebDAV to ~/Photos (unidirectionally for now, in order to # preserve server space) - echo "Syncing Photos from WebDAV to ~/Photos" - rsync -aq /mnt/nextcloud/Photos /home/djmoch/ + echo "Syncing Photos from WebDAV to $LOCAL_FOLDER" + rsync -aq /mnt/nextcloud/Photos/* $LOCAL_FOLDER # Finish by unmounting the WebDAV folder echo "Unmounting nextcloud.danielmoch.com"