Skip to content

Instantly share code, notes, and snippets.

@simonmulser
Last active May 23, 2017 14:17
Show Gist options
  • Save simonmulser/3c9dd3a70e43e766a26cb629ba06c9ab to your computer and use it in GitHub Desktop.
Save simonmulser/3c9dd3a70e43e766a26cb629ba06c9ab to your computer and use it in GitHub Desktop.
Check if grive didn't finished and print error message to sdout. Crontab will then mail you with postifx (https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp/).
#!/bin/bash
grive -p /home/simon/grive >> /tmp/grive.log 2>&1
if tail -1 /tmp/grive.log | grep -qv 'Finished!'; then
echo "There was en error executing grive. check /tmp/grive.log!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment