You can't really do this since the commands will be interactive. You might try this:
event manager applet backup
event cli pattern "write memory" sync no skip no
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "file prompt quiet"
action 4.0 cli command "end"
action 5.0 cli command "copy running ftp://username:passwd@server"
action 6.0 cli command "config t"
action 7.0 cli command "no file prompt quiet"
action 8.0 cli command "end"
In the future, use the Network Manager forum for EEM or TCL questions.