Вы должны отредактировать ваш motion.conf:
#Command to be executed when a picture (.ppm|.jpg) is saved (default: none)
#To give the filename as an argument to a command append it with %f
; on_picture_save value
Удалите ;
перед "on_picture_save" и отредактируйте свое значение с помощью команды оболочки для выполнения вашего скрипта.