Code:
#!/bin/bash
while [ true ]; do
# Sleep my pretty...
sleep 1
# Set our variables for directories and files
fDir1=`date +\%Y\%m\%d`
fDir2=`date +\%H`
fName=`date +\%Y\%m\%d\%H\%M\%S`
# Make the Directory + Download image to it
mkdir -p /home/knapcam/$fDir1/$fDir2
wget --quiet --output-document=/home/knapcam/$fDir1/$fDir2/knap1_$fName.jpg [address of camera]/still.jpg
done
exit 0
That should be fine to put in to /etc/rc.local using the nohup and background you posted
I changed it to set the variables of the dates you want and use them when creating directories etc in the extremely unlikely case that the minute ticked over between the mkdir and wget command
And alternative would be to add it to crontab as an @reboot task.