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