Hi all,
I'm trying to get cron to execute a shell script that takes a picture and uploads it to a Google Drive. I want this to happen every day at the same time, but right now I'm just testing to see if it'll do it every minute.
The shell script is called and contains the following:When I execute this script on its own, it successfully boots up the camera, takes a photo, saves it to testfolder, and then uploades the photo to my Google Drive.
However when I wrap this in a crontab (saved as /tmp/crontab.62vCd5/crontab):
Nothing happens. I get the message crontab: installing new crontab, but the script doesn't get executed.
Can anyone shed some light on what might be happening?
I'm trying to get cron to execute a shell script that takes a picture and uploads it to a Google Drive. I want this to happen every day at the same time, but right now I'm just testing to see if it'll do it every minute.
The shell script is called
Code:
newpicsync.sh
Code:
#!/bin/bashdate=$(date +"%Y-%m-%d")extension="jpg"new_filename=${date}.${extension}destination_path=""/Pictures/testfolder"/${new_filename}"#Take a picture using libcamera, save it with a datename-based filenamerpicam-still -o $destination_path#Sync the picture to my Google drive with rclonerclone copy /Pictures/testfolder TestDrive:rpipics/Camera1echo $destination_path
However when I wrap this in a crontab (saved as /tmp/crontab.62vCd5/crontab):
Code:
# Edit this file to introduce tasks to be run by cron.# ...# m h dom mon dow command* * * * * sh /home/username/newpicsync.sh
Can anyone shed some light on what might be happening?
Statistics: Posted by phylojenie — Wed May 15, 2024 5:38 pm