DB Backup to Google Drive

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

DB Backup to Google Drive

Post 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.
0x8086
Posts: 3
Joined: Monday 07 August 2017 15:52
Target OS: -
Domoticz version:
Contact:

Re: DB Backup to Google Drive

Post by 0x8086 »

bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: DB Backup to Google Drive

Post by bigpea »

I had seen this post but talk about uploading the backup via ftp. That's not what I need.
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: DB Backup to Google Drive

Post by bigpea »

Sorry, you are talking about rclone, i will see this option.
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: DB Backup to Google Drive

Post 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?
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: DB Backup to Google Drive

Post by bigpea »

ok with sudo command work very fine!
Thanks a lot.
ratjenl
Posts: 16
Joined: Saturday 12 August 2017 9:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: DB Backup to Google Drive

Post 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 :)
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: DB Backup to Google Drive

Post by bigpea »

How you fixed it? Was a problem if permission?
ratjenl
Posts: 16
Joined: Saturday 12 August 2017 9:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: DB Backup to Google Drive

Post 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.
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: DB Backup to Google Drive

Post by bigpea »

Ok i will try because in a raspberry it works fine and the same script in another raspberry doesn't work.
mivo
Posts: 80
Joined: Friday 21 April 2017 8:58
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Czechia
Contact:

Re: DB Backup to Google Drive

Post 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
My toys:
Raspberry Pi 3 + UPS PIco HV3.0 A Stack
Minibian (Raspbian Jessie) + Domoticz beta
RFLink 433 Gateway, 1wire DS18B20 temp sensors (GPIO)
RaZberry module + 2x Comet Z-Wave + Z-wave socket
---
Plugins: WeMo Switch, UPS PIco HV3.0A on GitHub
ratjenl
Posts: 16
Joined: Saturday 12 August 2017 9:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: DB Backup to Google Drive

Post 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 ;)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest