Hi Gabriele,
Thanks for your answer, it worked.
What i had to do for it to work:
1- barman list-files server_name backup_id --target full |tar cfz foo.tgz -T -
I set the --target parameter to full (don't if it's necessary) and as instructed by Gabriele, i piped it to tar, using the -T parameter to pass a list of files, and the - to tell it to get the list of files from stdin.
To restore the backup
i extracted it
created the recovery.conf file on the extracted folder
set the restore_command parameter to 'rsync -a /path/to/wals/%f %p'
When i tried to start the cluster, it complained that there were missing some folders.
I checked the original cluster, and the missing folders were empty, i guess barman does not copy empty folders during the backup procedure.
So i created them, started the cluest with pg_ctl -D /path/to/pgdata/ start .
And then it worked fine.
Thanks for your help