Copy all agent jobs to separate files based on date and keep five copies
A couple of suggestions:


Don't ask us to write an entire system for you.  It's probably ok if you have a particular problem with how some script operates, as long as it's DBMS related.
Realize that all SQL Server Agent Jobs are stored in the msdb system database.  In order to "save" jobs you could simply take a backup of the msdb database daily.  You should do that anyway, since there is a lot of useful history, etc, stored in there.
If you really need to "script" out the jobs, they're stored in msdb in the dbo.sysjobs and dbo.sysjobsteps tables.