1

I'm currently running a small database on a centos 7 server. I've one script for creating backups and another script for uploading them to googledrive using grive. However the script only uploads my files when I run it manually (bash /folder/script.sh). When it is run via crontab the script runs but it wont upload. I cant find any error messages in /var/log/cron or /var/log/messages.

Cron log entry:

Dec  7 14:09:01 localhost CROND[6409]: (root) CMD (/root/backupDrive.sh)

Here is the script:

#!/bin/bash
# Get latest file
file="$(ls -t /backup/database | head -1)"
echo $file

# Upload file to G-Drive
cd /backup/database && drive upload -f $file

1 Answers1

3

Add full path to drive or add its path to $PATH.

Cyrus
  • 84,225
  • 14
  • 89
  • 153
  • Thank you! It did the trick to add full path to drive (/usr/local/bin/drive). –  Dec 08 '15 at 18:23