Page 1 of 1

DB Backup to Google Drive

Posted: Sunday 06 August 2017 22:20
by bigpea
Hi all,
it's possible to upload automatically the backup of the db of domoticz directly to Google Drive?
Exist a script that do it?

Many thanks.

Re: DB Backup to Google Drive

Posted: Monday 07 August 2017 21:32
by 0x8086

Re: DB Backup to Google Drive

Posted: Tuesday 08 August 2017 9:38
by bigpea
I had seen this post but talk about uploading the backup via ftp. That's not what I need.

Re: DB Backup to Google Drive

Posted: Tuesday 08 August 2017 9:39
by bigpea
Sorry, you are talking about rclone, i will see this option.

Re: DB Backup to Google Drive

Posted: Tuesday 08 August 2017 11:45
by bigpea
It is very intuitive and quick to apply this script.
Just one thing: the script give me an error of "access denied" when i try to access to db, how did you overcome this problem?

Re: DB Backup to Google Drive

Posted: Tuesday 08 August 2017 12:01
by bigpea
ok with sudo command work very fine!
Thanks a lot.

Re: DB Backup to Google Drive

Posted: Saturday 12 August 2017 9:19
by ratjenl
Hi,

I installed the script and it works out of the box when i use the command to upload the database however it doesn't work when i put it in crontab.

When i copy the line from crontab and execute it manually it works fine but crontab doesn't do anything. Could anyone help me to get it to work ?
My crontab looks like this :

0 1 * * * /home/pi/Dropbox-Uploader/dropbox_uploader.sh upload /home/pi/domoticz/domoticz.db domoticz/domoticz$(date +%d).db >/dev/null 2>&1

edit : Fixed it already :)

Re: DB Backup to Google Drive

Posted: Saturday 12 August 2017 11:17
by bigpea
How you fixed it? Was a problem if permission?

Re: DB Backup to Google Drive

Posted: Saturday 12 August 2017 20:05
by ratjenl
I don't know what it was, i just made an extra script which i put in crontab that executes this line. I really don't know why crontab won't execute it but now it works ok.

Re: DB Backup to Google Drive

Posted: Saturday 12 August 2017 20:34
by bigpea
Ok i will try because in a raspberry it works fine and the same script in another raspberry doesn't work.

Re: DB Backup to Google Drive

Posted: Saturday 12 August 2017 20:58
by mivo
Hi,

there is specific behaviour of special characters in crontab, like $(date +%d). Look at this:

https://unix.stackexchange.com/question ... on-tab-job

You can store output of "date" command to variable in beginning of crontab, or call another script, as mentioned by @ratjenl and do anything there

Re: DB Backup to Google Drive

Posted: Saturday 12 August 2017 22:38
by ratjenl
mivo wrote: Saturday 12 August 2017 20:58 Hi,

there is specific behaviour of special characters in crontab, like $(date +%d). Look at this:

https://unix.stackexchange.com/question ... on-tab-job

You can store output of "date" command to variable in beginning of crontab, or call another script, as mentioned by @ratjenl and do anything there
Aaaah nice, thnx for the link. I went for the easiest was but it is not the cleanest. I am new to the domoticz world so i chose the easy way ;)