lftp  

suppress the warning when mkdir an existing dir

Jun Wan
Fri, 06 Aug 2010 02:15:31 -0700

Hi,

I am writing a script that puts files into a remote directory, also
create that directory
if it does not exist in the remote host. Is there a way to have mkdir
not emit the
warning when the dir already exists? Currently it complains:

mkdir: Access failed: Failure (test44)      # test44 is the directory name

There is no harm done to remote host, but the message is a bit confusing
for my user to see - they think something is wrong, where it is really
OK. So I want to suppress the message.

Alternatively, is there lftp commands to do this:

if [ ! -d "$dir" ]; then
mkdir $dir
fi

Thanks!

Jun
  • suppress the warning when mkdir an existing dir Jun Wan