I am trying to make motion upload every picture it takes.
I have the following line in my motion.conf
on_picture_save = /root/ftpput.sh %f

and the ftpput.sh script looks like this
ftp -n <<END_SCRIPT
quote USER valvonta
quote PASS valvonta
put $ 1
exit 0

The script works fine if I run it separately but with motion.