Backup works, but not in crontab...

All kinds of 'OS' scripts
Post Reply
Jumper3126
Posts: 58
Joined: Thursday 31 December 2015 16:26
Target OS: Raspberry Pi
Domoticz version:
Contact:

Backup works, but not in crontab...

Post by Jumper3126 » Sunday 24 December 2017 14:07

Hi,
Anyone has an idea where this goes wrong?
I used the bash script to backup to my NAS. This works fine if I use the manual command:

Code: Select all

sudo ~/domoticz/scripts/bash/Domoticz_Backup.sh

However, I want to have it run daily in crontab. The following command however appears not to work, and I discovered it too late, after my system crashed last night and I dont have a recent backup :? Other crontab commands work fine.

Code: Select all

0 15 * * * sudo ~/domoticz/scripts/bash/Domoticz_Backup.sh

Domoticz_Backup.sh was made executable by the way

CaesarPL
Posts: 119
Joined: Tuesday 08 November 2016 15:03
Target OS: Raspberry Pi
Domoticz version:
Location: Poland
Contact:

Re: Backup works, but not in crontab...

Post by CaesarPL » Sunday 24 December 2017 14:19

Seems fine. Maybe providing full path to script will help?
HW:Raspberry PiB+,Pi3,PiB,RFLink,FA20RF,DCS-930L,DCS-935L,Clarus switches,RF Temp sensors,Owl Micro+,Mi Flora,Kerui,Yeelight,Xiaomi,Broadlink RMM3,Alexa
SF:Jessie,Dmtcz 3.8153,Logitech Media srv,PiCorePlayers,Dashticz,Max2Play,InfluxDB,Grafana,HABridge

Jumper3126
Posts: 58
Joined: Thursday 31 December 2015 16:26
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Backup works, but not in crontab...

Post by Jumper3126 » Sunday 24 December 2017 15:51

good news: that worked!
bad news: no idea why this worked, thought programming was all about logic.
Anyhow, thanks for the help

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest