I created some bash scripts within the cron.hourly folder to run some tasks hourly when a machine is on.
cron_update_images scripts work just fine within the cron job.
53 * * * 2 /etc/cron.hourly/cron_pull 55 * * * 2 /etc/cron.hourly/cron_update_images 57 * * * 2 /etc/cron.hourly/cron_start_slideshow #This is the problem script
The final script does not run as expected and I'm not sure why. If I run the script manually, it starts the slideshow no problem. Here is the code inside
# Code that will prevent duplicate cronjobs from happening PIDFILE=~/Documents/scripts/cron_pull.pid if [ -f $PIDFILE ] then PID=$(cat $PIDFILE) ps -p $PID > /dev/null 2>&1 if [ $? -eq 0 ] then echo "Process is already running" exit 1 else # Process not found, assume it is not running echo $$ > $PIDFILE if [ $? -ne 0 ] then echo "Could not create PID file" exit 1 fi fi else echo $$ > $PIDFILE if [ $? -ne 0 ] then echo "Could not create PID file" exit 1 fi fi # Start the slideshow of images eog --slide-show /media/images # Remove the PID file showing the process is complete rm $PIDFILE
Anything helps, thanks!