From d0a56b83cfe59242f5f773dbe9a62c83e25963f9 Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Tue, 11 Jun 2019 17:14:51 +0200 Subject: [PATCH] Add sync-drive script Resolves #5 Signed-off-by: Severin Kaderli --- system/.config/cron/crontab | 2 +- system/.local/bin/sync-drive | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 system/.local/bin/sync-drive diff --git a/system/.config/cron/crontab b/system/.config/cron/crontab index 8fc0639..6cbb4a9 100644 --- a/system/.config/cron/crontab +++ b/system/.config/cron/crontab @@ -11,7 +11,7 @@ # This file is loaded on boot by crontab. # Synchronize Google Drive every 15 minutes -*/15 * * * * grive -d -p $HOME/documents/ >> $HOME/.local/log/cron.log 2>&1 +*/15 * * * * $HOME/.local/bin/sync-drive >> $HOME/.local/log/cron.log 2>&1 # Sync pacman databases every 15 minutes */15 * * * * sudo $HOME/.local/bin/sync-packages >> $HOME/.local/log/cron.log 2>&1 diff --git a/system/.local/bin/sync-drive b/system/.local/bin/sync-drive new file mode 100644 index 0000000..c0ffea6 --- /dev/null +++ b/system/.local/bin/sync-drive @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# SCRIPT NAME: +# sync-drive +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# Syncs Google Drive folder +# +# USAGE: +# ./sync-drive +. /home/severin/.local/bin/utils + +if [ ! -d "/home/severin/documents" ]; then + exit +fi + +print_time_log "sync-drive" "Syncing with Google Drive" +grive -d -p /home/severin/documents/ \ No newline at end of file