Hi, need help to integrate this script with bareos,
#!/bin/bash # # This script provides hdfs file copies do Bacula bpipe plugin (FIFO) using multiple hdfs cat commands when backing up and multiple put commands to restore. # Next backups will only copy changed files from hdfs after last backup recorded time (/etc/last_backup). # # Remark: hdfs /tmp and .tmp. folders are excluded by the grep -v. # # By Heitor Faria (http://bacula.us | http://www.bacula.com.br); # Marco Reis; # Julio Neves (http://livrate.com.br) and # Rodrigo Hagstrom # # Tested with Hadoop 2.7.1; August, 2017. # # It must be called at the FileSet INCLUDE Sub-resource, used by the job that # backups a Hadoop node with a Bacula Client, like this (e.g.): # # Plugin = "\|/etc/script_hadoop.sh" hdfs="/usr/bin/hdfs" if [[ ! -p /etc/last_backup ]]; then echo "00-00-00;00:00" > /etc/last_backup fi Date=$(cat /etc/last_backup | cut -f 1 -d ";") Hour=$(cat /etc/last_backup | cut -f 2 -d ";") for filename in $($hdfs dfs -ls -R / | awk -v date="$Date" '$6>=date && $2!="-" {print $7 " " $8}' | awk -v hour="$Hour" '$1>=hour {print $2}' |grep -v -e /tmp/ -e .tmp.) do echo "bpipe:/$filename:$hdfs dfs -cat $filename:$hdfs dfs -put -f /dev/stdin $filename" done date '+%Y-%m-%d;%H:%M' > /etc/last_backupВведите код... -- You received this message because you are subscribed to the Google Groups "bareos-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/01cc7661-c4c5-48ef-8d3d-a829a7678f4d%40googlegroups.com.