Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /documents/accounts/transfer/done/abc_yyyy-mm-dd_hh-mm-ss-[0-9]{6}.csv
- /documents/namelist/transfer/done/def_yyyy-mm-dd_hh-mm-ss-[0-9]{6}.csv
- /documents/newcustomer/transfer/done/ghijkl_yyyy-mm-dd_hh-mm-ss-[0-9]{6}.csv
- #!/bin/bash
- date=`date +%Y-%m-%d`;
- config_file="/scripts/config/abc.cfg";
- echo $config_file;
- URL="http://localhost:9200/document-$date";
- find /documents -type f -name "*_'${date}'*.csv" | while read filename
- do
- echo "filename : ${filename}"
- var=$(base64 $filename| perl -pe 's/n//g');
- var1= curl -XPUT 'http://localhost:9200/documents-'$date'/document/?pipeline=attachment&pretty' -d' { "data" : "'$var'" }')
- done;
- find -type f -name "*_${date}*.csv"
- touch abc_2016-12-28-3523424-acsfsc.csv
- touch abc_2016-12-29-3523424-acsfsc.csv
- find . -maxdepth 1 -type f -print
- ./abc_2016-12-28-3523424-acsfsc.csv
- ./abc_2016-12-29-3523424-acsfsc.csv
- date=$(date +%Y-%m-%d)
- find -type f -name "*_${date}*.csv"
- ./abc_2016-12-28-3523424-acsfsc.csv
- while IFS='' read -r -d '' filename
- do
- echo "filename : ${filename}"
- var=$(base64 "$filename"| perl -pe 's/n//g');
- var1=$(curl -XPUT "http://localhost:9200/documents-$date/document/?pipeline=attachment&pretty" -d '{ "data" : "'"$var"'" }')
- done < <(find -type f -name "*_${date}*.csv" -print0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement