I am trying to create a bashscript to upload files from the local edge node filesystem to hdfs. I was wondering a good way to add the timestamp in the file. Having some problems with getting timestamp to work.
#!/bin/bash
echo Running upload script to hdfs...
timestamp(){date +"%T"}
hdfs dfs -put /home/myname/folder1/* /user/myname/example_1_$(timestamp).txt
hdfs dfs -put /home/myname/folder2/* /user/myname/example_2_$(timestamp).txt
example_1_11:20:15.txt
?:
is not possible. Check below answer.