I need to create a path with a variable value which contains yesterday date. I need to get files using SFTP. Here is my try.
#/bin/bash
TS=$(date -d '30 mins ago' +"%Y%m%d")
sshpass -p '12#$' sftp -P 2222 User_New@10.18.16.14 <<'END_SFTP'
get /newNE/PSData$TS* /data/processedfiles
END_SFTP
But TS
date value is not passing to remote server to get data.
File "/newNE/PSData$TS*" not found.
Can someone help me to solve this?