Hi!
I want to synchronize photos taken on Raspberry Pi to Google Drive.
The capture_photo.sh script works automatically using crontab, but the rclone.sh script, which should upload the photo to google drive, only works if I run it terminal(not when crontab is running).
[capture_photo.sh]
#!/bin/bash
for ((i=1; i<=10; i++))
do
timestamp=$(data +%y%m%d_%H%M%S)
filename="/home/pi/Farm/p_$timestamp.jpg"
sudo libcamera-still --immediate -o $filename
sleep 2
done
It was originally
pi@raspberrypi:~ $ rclone config file
Configuration file is stored at:
/home/pi/.config/rclone/rclone.conf
, but I changed it to
pi@raspberrypi:~ $ rclone config file
Configuration file is stored at:
/opt/rclone/rclone.conf
using
sudo mkdir -p /opt/rclone(Because there was no "/opt/rclone" file.)
sudo mv /home/pi/.config/rclone/rclone.conf /opt/rclone/rclone.conf
.
And
export RCLONE_CONFIG=/opt/rclone/rclone.conf
did.
Then, when I run crontab, an error(Failed to load config file "/opt/rclone/rclone.conf": open /opt/rclone/rclone.conf: permission denied) appears.
Is it wrong to change it like that?
Since I did it like that, nothing worked as it should have... What should i do?
(I am a beginner and a student. I would appreciate it if you could provide as much detail as possible.)
There's no big reason. I search google to solve the problem, and I saw a comment that was written like that on a similar problem to mine. So I tried it.
If I don't have to do it like that, don't have to move it.
(i would appreciate it if you could continue to help me.)