Add sync-drive script

Resolves #5

Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
Severin Kaderli 2019-06-11 17:14:51 +02:00
parent cdf03d6c96
commit d0a56b83cf
Signed by: severinkaderli
GPG key ID: F419F8835B72F0C4
2 changed files with 22 additions and 1 deletions

View file

@ -11,7 +11,7 @@
# This file is loaded on boot by crontab. # This file is loaded on boot by crontab.
# Synchronize Google Drive every 15 minutes # 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 # Sync pacman databases every 15 minutes
*/15 * * * * sudo $HOME/.local/bin/sync-packages >> $HOME/.local/log/cron.log 2>&1 */15 * * * * sudo $HOME/.local/bin/sync-packages >> $HOME/.local/log/cron.log 2>&1

View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# SCRIPT NAME:
# sync-drive
#
# AUTHOR:
# Severin Kaderli <severin@kaderli.dev>
#
# 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/