You edit your crontab with this command:
There are a lot of other references out there that can tell you all the exact syntax, but basically first you say how often you want the job to run, then you say what command should be run.
Code:
45 18 * * * /home/chris/bin/backup.sh
That would run every night at 6:45pm. The first column is minutes, the second hours, third days of the month, fourth is month, and the fifth is day of the week. So
Code:
30 02 * * 2 /home/chris/bin/backup.sh
would run at 2:30am every Tuesday, and
Code:
0 6 1 1 * /home/chris/bin/backup.sh
would run only once a year, at 6:00am on New Years. That script you have should do just fine, although you'll only ever have one backup file at a time. Every time the script runs it will overwrite the old one. If you want a new file each time, you could do this:
Code:
tar czf /Downloads/html.bak/htmlbackup-`date +%Y-%m-%d`.tar.gz .
That will append the date to the end of the filename. Oh, and the usual practice is to use .tar.gz for the file extension, not .sh.tar.gz.