/tool fetch url doest work

Hi i try to fetch all files in /file and copy them to a other mikrotik.
When i use the tool in command line it works fine, but inside the script it doesnt. Can someone tell me how to write it correct?

/tool fetch url=sftp://XXXXXX/test.txt upload=yes user=backupuser password=XXXXXXsrc-path=test.txt src-address=XXXXX

:foreach a in=[/file find] do={
    /tool fetch url=("sftp://XXXXXXX/" .$a) upload=yes user=backupuser password=ashahahha src-path=$a src-address=92.XXXXXXX;
    }
}

thx

mark

You forget to not send… directories and disks…
Your remote sftp create directories when are not presents?

:local filelist ""
/file
:foreach file in=[find where type!=disk and type!=directory] do={
    /tool fetch url=("sftp://XXXXXXX/$file") upload=yes user=backupuser password=ashahahha src-path=$file src-address=92.x.x.x
}

For true backup you can adapt this, is by mail, but you can modify it to use fetch:
http://forum.mikrotik.com/t/router-crashes-are-wiping-the-config/149189/7