Last active
January 16, 2018 12:45
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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