Its analogous to "every which way" or "as much/often as possible."  According to lastsource.com (which is linked below in cached form, as I was having trouble accessing the site), the phrase originated in Rome during the early days of Christianity:  In order to encourage Church-goers to show up to Mass on time, the parish priest would have the last person to arrive beaten mercilessly the other 6 days of the week.
What does the term "Six ways from Sunday" mean?