How do I handle mutually exclusive flags with getopts?

How do I handle the absence of flags?

I'm writing a script that normally runs from cron and backs up my hard
drive.

But I'd like to be able to run it manually and specify via flags the 
backup I want to run - daily or monthly.

$ backup -d     # daily backup
$ backup -m     # montly ..

So the script is run without any options specified by cron but I'd like
to be able to run it with two mutually exclusive flags from the command
line.

Thanks!


Reply via email to