Hi,
This is my first go at writing a bash script, which so far works fine when I execute it from the command prompt but I need some help getting cron to run it.
Thanks to Mr Google, I found and adapted a piece of code to get myscript.sh to do what I want, which is to open an app called camorama for 5 minutes (so it can take a series of still shots from a webcam 1 minute apart)
#!/bin/bash
# myscript.sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
echo "pkill -KILL -f 'camorama'" | at now + 5 minutes
camorama -M
echo "Goodbye Camorama"
[snipped other lines from script]
All is fine with the above in that it does what I want from the command line when I type "bash myscript.sh", however, I need it to be scheduled with cron. I created the following cron job (crontab -e) and tested it. I know the cron job is running and myscript.sh is invoked but for some reason (some permission thing?) the piece of code for camorama isn't doing anything.
# m h dom mon dow command
51 17 * * * /home/rich/myscript.sh
53 17 * * * echo "testcam" > /home/rich/output.txt
I have a feeling it's a permission thing, but I've exhausted my linux abilities! I'd appreciate any help.
Regards
Rich






