Skip to content

Instantly share code, notes, and snippets.

@ivankeller
Last active January 16, 2018 12:45
Show Gist options
  • Save ivankeller/b9a1ea97b04a0f0db37ea6ffa6a3c470 to your computer and use it in GitHub Desktop.
Save ivankeller/b9a1ea97b04a0f0db37ea6ffa6a3c470 to your computer and use it in GitHub Desktop.
Workaround script to copy from hdfs file system to NAS when writing restrictions
#!/bin/bash
# Workaround script to copy from hdfs file system to NAS
# solving permission limitation at writing on NAS directly with hdfs command
#
# Usage:
# $ hdfs2Nas <full path> <destination directory>
SOURCE=$1
DEST=$2
TMP=~/tmp
FILENAME=$(basename $SOURCE)
hdfs dfs -copyToLocal $SOURCE $TMP
sudo cp $TMP/$FILENAME $DEST
rm $TMP/$FILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment