Note: I am not responsible if this breaks your iphone or ipod.
Open up Cydia from your phone/ipod and scroll down to OpenSHH. Follow steps 1-4.
1) Download WinSCP
a) Create a folder on your desktop called iPhone backup or something like that
b) Open up a new connection in WinSCP
c) Your host address is the ip you got from Cydia
d) Username is root and Password is alpine
3) None of these steps are mandatory, It depends what you want to backup
a) First, we'll start off with the most complicated. /Applications. I recommend applying the default theme before backing up. This way, all of the icons will be default, and you can just reapply the theme through Customize/Winterboard after restoring. If you really want to keep your theme, then leave the icons as is and copy the WHOLE /Applications folder. NOTE that this WILL be the default theme if you attempt to apply a defualt one, and you will NOT be able to get backup icons.
...........* If you want the default theme back, apply it and erase all changes made through Winterboard/Customize, and then copy everything but default applications. Skip over App Store, Calculator, DemoApp, Maps, MobileAddressBook, MobileCal, MobileMail, MobileMusicPlayer, MobileNotes, MobileSafari, MobileSlideShow, MobileStore, MobileTimer, Preferences, Stocks, Weather, and YouTube. This will make the overall SSH'ing process much shorter and will save you a lot of hassle.
b) /usr/bin, if you want to backup command line utilities you've installed
c) /private/var/mobile/Media/DCIM, to back up photos from Safari and screenshots in the camera roll
d) If you have ROMs and don't have them backed up on your computer, you might want to backup /private/var/mobile/Media/ROMs
e) /private/var/mobile/Documents, if you have it
f) /private/var/mobile/Library, for settings
g) /private/var/root/Library, for contacts, SMS, etc.
h) If you want to backup all of your installed applications on Cydia so that you can get updates as soon as you SSH them back in, /private/var/lib
i) For Winterboard themes, /Library/Themes
j) /private/var/stash/Wallpaper.xxxxxx, if you want to backup the wallpapers
k) If you want to keep your theme totally, /System/Library/CoreServices (Docks, Badges, Carrier images, etc). I don't recommend this.
l) If you changed fonts and want to keep them, /System/Library/Fonts
Thats it. Your phone/ipod is backed up.
You must have your iphone/ipod jailbreaked to do this.
To jailbreak your iphone/ipod, read this tutorial