Want to take iphone backup by code

hi........
I want to take iphone backup by code...using itunes services or command.....