vitalif / grive2

Google Drive client with support for new Drive REST API and partial sync
http://yourcmc.ru/wiki/Grive2
GNU General Public License v2.0
1.52k stars 140 forks source link

Crontab #351

Open kairosart opened 2 years ago

kairosart commented 2 years ago

How can I run grive in crontab? I've tried with 0 19 * * * /usr/local/bin/grive and there's not any sync, even though the program runs.

pyro12 commented 2 years ago

I think your current directory needs to be your grive directory for it to sync. I would try a simple bash file that sets your current directory to ~/grive (or whatever) and then runs grive. Set your cronjob to run the script and not grive directly.

#!/bin/bash
cd ~/grive
grive

A lot of us use some permutation of the following bash file and set it to run at startup using whatever method your Desktop Environment supplies to keep things sync'd.

#!/bin/bash
sleep 2m
cd ~/grive
while true
do
grive
sleep 5
done
kairosart commented 2 years ago

Thanks. I'll try.

On Fri, 22 Oct 2021 at 14:51, pyro12 @.***> wrote:

I think your current directory needs to be your grive directory for it to sync. I would try a simple bash file that sets your current directory to ~/grive (or whatever) and then runs grive. Set your cronjob to run the script and not grive directly.

!/bin/bash

cd ~/grive grive

A lot of us use some permutation of the following bash file and set it to run at startup using whatever method your Desktop Environment supplies to keep things sync'd.

!/bin/bash

sleep 2m cd ~/grive while true do grive sleep 5 done

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vitalif/grive2/issues/351#issuecomment-949602513, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABR5ZORXUMOS76CQA7VTUFLUIFM5ZANCNFSM5GMFTVAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- E. Astasio

ATENCIÓN:

Si la dirección del remitente de los mensajes recibidos contiene un email donde no se puede contestar, se considerarán como no recibidos, no se leerán e irán directamente a spam. Por favor, envíen solamente mensajes desde direcciones donde sea posible responder. *WARNING*Any message with noreply address will be considered spam an it won't be read. Please, send only mails to this address from valid email adresses.