How to take complete backup of site code?

How to take complete backup of site code?, i have tried to take the backup of website code by downloading it through Filezilla tool, but unfortuntely it gets stops, and breaks download in between and i have to start from fresh, i was looking of ways where you can download incrementally without starting all over again from scratch , what is the best practices to take backup and download the code of website?