Last active
March 3, 2017 06:05
-
-
Save intrd/cac69cac2b1adff69cf3379026791d1e to your computer and use it in GitHub Desktop.
Google Drive - Auto-sync(push/pull) script for odeke-em/drive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Google Drive - Auto-sync(push/pull) script for odeke-em/drive | |
# @author intrd - http://dann.com.br/ | |
# @license Creative Commons Attribution-ShareAlike 4.0 International License - http://creativecommons.org/licenses/by-sa/4.0/ | |
# gdrive4linux - https://github.com/odeke-em/drive | |
# crontab line: */1 * * * * /home/intrd/cloud/sync.sh >> /home/intrd/cloud/log.txt 2>&1 | |
# Uncomment "while" to test w/out cron | |
#while true | |
#do | |
cd /home/intrd/cloud/ | |
if inotifywait -t2 -e modify -e move -e create -e delete -r /home/intrd/cloud/; then | |
/home/intrd/.gvm/pkgsets/go1.5.2/global/bin/drive push -fix-clashes -quiet | |
/home/intrd/.gvm/pkgsets/go1.5.2/global/bin/drive pull -fix-clashes -quiet | |
echo "PUSHED" | |
fi | |
/home/intrd/.gvm/pkgsets/go1.5.2/global/bin/drive pull -fix-clashes -quiet | |
/home/intrd/.gvm/pkgsets/go1.5.2/global/bin/drive push -fix-clashes -quiet | |
echo "PULLED" | |
#done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment