while [ -e "$outfile" ]; do
num=$(( num + 1 ))
raspistill -o "$outfile"
The loop in the above script will increment the
num variable by one and create a new output filename in
outfile using this number, until a filename that is no taken is found.
This potentially fails if multiple copies of the script are run simultaneously, as there is a race condition between testing for the existence of the filename and creating the new file. Running the script with a one minute interval should not be a problem unless it takes a minute or longer for
raspistill to create the new file. In this case, add
touch "$outname" after the loop to "claim" the filename as soon as possible (simultaneous invocations of the script may still fail though).
By "failing" I mean two or more invocations of the script using the same filename with