How to write shell script for sqoop

WARN security.UserGroupInformation: PriviledgedActionException as:cloudera (auth:SIMPLE) cause:org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory hdfs://quickstart.cloudera:8020/user/cloudera/sqoop/sqoop_import_data already exists
i have written sqoop commands in .sh file and excuted it, after excuting it for 2nd time i got this error, Iam confused like how to write sqoop commands in shell script

either delete the hdfs path mentioned in the error or use --delete-taget-dir argument with sqoop command

i got lik this error and in i should give hdfs path write to load the data from rdbms to hdfs using sqoop
17/04/17 14:01:56 ERROR tool.BaseSqoopTool: Unrecognized argument: --delete-taget-dir

–delete-target-dir. r was missing --delete-taget-dir

1 Like

@laxmipriyanka1992 Use --delete-target-dir

​It will delete provided in command before writing data to this directory.

1 Like