Created
April 27, 2020 08:48
-
-
Save Zejnilovic/6b58b300270237ce8cd439c858fabdb3 to your computer and use it in GitHub Desktop.
A simple HDFS backup for local playing
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 | |
now=$(date +"%Y_%m_%d") | |
file=hadoop_backup_$now | |
cd ~ | |
mkdir -p $file | |
hdfs dfs -ls / | grep "^[d-]"| awk '{print $8}' | while read line; do hdfs dfs -get $line $file ; done | |
zip -r $file.zip $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment