> The 200-220 periodic files under daily expect that the directory
> /var/backups exist when they run to back up various files. If you
> delete this directory, the "cp" commands will error.
>
> There seems to be two ways to fix the files.
>
> 1. Add a "if [ ! -d $bak ] ; then exit fi" to the top
> of the files, or
>
> 2. Add a "mkdir -p $bak" to the top.
>
> Do others consider this an error, and if so which is the preferred
> fix?
I consider it an error, but prefer neither fix, here is something more
defensive and verbose in light of failure modes:
if [ ! -e $bak ] ; then
echo "${0}: $bak missing, creating";
mkdir -p $bak;
else
if [ ! -d $bak ] ; then
echo "${0}: $bak exists and is not a directory, aborting";
exit 1;
fi
fi
--
Rod Grimes - KD7CAX - (RWG25) [EMAIL PROTECTED]
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message