Code:
#!/bin/bash
crontab_add()
{
	# when (m h dom mon dow) command
	(crontab -l 2> /dev/null | grep -v -F "$2" ; echo "$@") | crontab
}

crontab_del()
{
	crontab -l 2> /dev/null | grep -v -F "$@" | crontab
}

crontab_add '0 3 * * *' /home/user/restart_daily.sh
crontab_del /home/user/restart_daily.sh
Adding will make sure that the same script is not added twice (that's what grep -v is for)

I prefer functions, but you could do the same with one line:

Adding:
Code:
 (crontab -l 2> /dev/null | grep -v -F "/some/restart.sh" ; echo "0 3 * * * /some/restart.sh") | crontab
Deleting:
Code:
crontab -l 2> /dev/null | grep -v -F "/some/restart" | crontab
P.S. I wouldn't recommend using /var/spool/cron/tabs directly, because cron daemon might not read them after you have made changes, that's why there's "crontab" utility.
P.P.S. There's usually /etc/cron.daily /etc/cron.hourly and so on, but sometimes you just need special execution time