I didn't see exactly what you want here but they have a number of scripts that you could use as a basis. They have both backup and scheduled functions just not both in the same script. Be sure to check you have a new enough IOS since they have added many things in the later ones. This is one of my favorite new ios feature.
Changing the terminal length to 0 makes the "show run" command execute without the normal page breaks. Terminal length 24 is the default setting, so you reset it after you have run the "show run" command.