creating a simple archiving script

Im trying to create a script to archive specified directories into a specified tarball backup file. This is what i want the input to look like
ex. save -i '/bin/b*' -i '/bin/ls' -o backup

this is what i have
#!/bin/bash
#save - backup file script
unset myInput
unset myOutput
while getopts "i: o:" myOpt
do
if [ $myOpt == "i" ]
then
myInput=$myInput" "$OPTARG
elif [ $myOpt == "o" ]
then
myOutput=$OPTARG
fi
done
echo "[Backing up $myInput to $myOutput]"
if test -f $myOutput
then
echo "$myOutput already exists: must rename"
fi
echo "Input file list: "
for file in $myInput
do
ls -laR "$file"
done

A suggestion with your archiving is that you date/time stamp your files.
That way you avoid the need for the "$myOutput already exists: must rename" case.

Noticed a strangely similar question [ creating an archiving script (UNIX for Dummies Questions & Answers) ]

Forum Rules:
(6) Do not post classroom or homework problems.

Yup. Looks like homework. Closing the thread.