Wednesday, December 26, 2012

Create a MySql Trigger to run shell script on insert




delimiter ;;
create trigger smf_message_trigger
after insert on smf_messages
for each row
begin
set @stupid_var=sys_exec(CONCAT('/home2/luxefash/triggers/smf.sh  '+ id_topic ));
end;
;;
delimiter ;


Shell script:


#/usr/bin/sh

echo "test " >> /tmp/smf.log


No comments:

Post a Comment