Create your script file, say /etc/rc.d/rc.local.stop, and create links to it in
the two directories /etc/rc.d/rc.d. Make sure the script is
executable. I'm not sure if the shutdown process waits for your script to finish or if it times out, but it doesn't hurt to give it a try (and post back here as I'd be interested to know
If you're in the situation where your backup scripts aren't run regularly because your machine is never on when cron runs things you might consider installing anacron. This means it will run missed jobs when the machine starts up, this might slow you down for a few minutes after you start the machine though.