fredfillis
Posts: 13
Joined: Sat Feb 08, 2014 6:37 am

Raspbian: Script works from bash but not when run by cron?

Sat Feb 08, 2014 9:41 am

Very noob here, trying to make the Pi into a digital picture frame. I'm attempting to tweak some scripts I found here http://rberrypi.blogspot.com.au/2013/05 ... cture.html. I'm booting Raspbian into the desktop and then have put together my versions of the scripts by cutting and pasting and then editing accordingly.

The various scripts work correctly when I run them in terminal but when I add them to crontab they appear to run but there is no output (my show never starts, for example).

Here is my script. Relevant entries from cron.log follow. Any pointers on why I might get the behavior I've described?

Code: Select all

#!/bin/sh
#
# Script to run Digital Picture Frame using Feh
# drware@thewares.net
#

# Change number below to the duration, in seconds
# for each photo to be displayed
DELAY="10"

# hide the cursor after 5 seconds
/usr/bin/unclutter -idle 5 &

# Start slide show
feh --quiet --recursive --randomize --full-screen --slideshow-delay $DELAY /mnt/data1/Pictures/ &

# Phone home and sync
#/home/pi/frame/rsync.sh

exit 0

Code: Select all

cron.log
Feb  8 17:00:01 Raspbian01 /USR/SBIN/CRON[3065]: (root) CMD (/home/pi/frame/turn_on_screen.sh)
Feb  8 17:01:01 Raspbian01 /USR/SBIN/CRON[3075]: (root) CMD (/home/pi/frame/cron_start_frame.sh)
Feb  8 17:02:01 Raspbian01 /USR/SBIN/CRON[3080]: (root) CMD (/home/pi/frame/turn_off_screen.sh)

Return to “Beginners”