GET file with respect to yesterdays date using SFTP [on hold]FTP bulk download and renameBash script variable...

In what ways can a Non-paladin access Paladin spells?

Which household object drew this pattern?

Factoring the square of this polynomial?

Fancy String Replace

If all stars rotate, why was there a theory developed, that requires non-rotating stars?

How does turbine efficiency compare with internal combustion engines if all the turbine power is converted to mechanical energy?

Fried gnocchi with spinach, bacon, cream sauce in a single pan

Why don't electrons take the shorter path in coils

When translating the law, who ensures that the wording does not change the meaning of the law?

Three Singles in Three Clubs

Is there such a thing as too inconvenient?

How would one country purchase another?

How much code would a codegolf golf if a codegolf could golf code?

Would it be possible to have a GMO that produces chocolate?

Do ability scores have any effect on casting Wish spell

What is this symbol: semicircles facing eachother

What is wrong about this application of Kirchhoffs Current Law?

Are illustrations in novels frowned upon?

Is there a known non-euclidean geometry where two concentric circles of different radii can intersect? (as in the novel "The Universe Between")

Is “I am getting married with my sister” ambiguous?

Justifying the use of directed energy weapons

If I have a 16.67% fail rate (N=24) & I do another 24 tests, what is the likelihood that I get 0 fails by chance?

If the first law of thermodynamics ensures conservation of energy, why does it allow systems to lose energy?

How to refer to a regex group in awk regex?



GET file with respect to yesterdays date using SFTP [on hold]


FTP bulk download and renameBash script variable with if else statement but with loopHow to use sed to replace a string using the line number on a remote machine using ssh?Assigning variables from text in filenamessh key exchange failed couldnt read packetAlias for recent log files






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am trying to download yesterday's files from the server using a bash file with the following code:



   export SSHPASS=$SFTP_PASS
YESTERDAYS_DATE=`$DATE -d "-1 day" +"%Y%m%d"`

sshpass -e sftp -oBatchMode=no -b - $SFTP_USER@$SFTP_HOST<<-'EOF'
mget FILENAME$YESTERDAYS_DATE.txt
EOF


But unfortunately SFTP treating $YESTERDAYS_DATE as a string. My file name is something like FILENAME20190815.txt. Can please someone help me to achieve this.










share|improve this question
















put on hold as off-topic by Jeff Schaller yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – Jeff Schaller














  • 1





    Possibly due to the quotes around 'EOF'. See stackoverflow.com/questions/4937792/…

    – xenoid
    2 days ago











  • @xenoid you are absolutely right...Thank you for your help

    – BASEER HAIDER JAFRI
    2 days ago











  • Crossposted on Stack Overflow: stackoverflow.com/q/57562853/850848

    – Martin Prikryl
    yesterday


















0















I am trying to download yesterday's files from the server using a bash file with the following code:



   export SSHPASS=$SFTP_PASS
YESTERDAYS_DATE=`$DATE -d "-1 day" +"%Y%m%d"`

sshpass -e sftp -oBatchMode=no -b - $SFTP_USER@$SFTP_HOST<<-'EOF'
mget FILENAME$YESTERDAYS_DATE.txt
EOF


But unfortunately SFTP treating $YESTERDAYS_DATE as a string. My file name is something like FILENAME20190815.txt. Can please someone help me to achieve this.










share|improve this question
















put on hold as off-topic by Jeff Schaller yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – Jeff Schaller














  • 1





    Possibly due to the quotes around 'EOF'. See stackoverflow.com/questions/4937792/…

    – xenoid
    2 days ago











  • @xenoid you are absolutely right...Thank you for your help

    – BASEER HAIDER JAFRI
    2 days ago











  • Crossposted on Stack Overflow: stackoverflow.com/q/57562853/850848

    – Martin Prikryl
    yesterday














0












0








0


1






I am trying to download yesterday's files from the server using a bash file with the following code:



   export SSHPASS=$SFTP_PASS
YESTERDAYS_DATE=`$DATE -d "-1 day" +"%Y%m%d"`

sshpass -e sftp -oBatchMode=no -b - $SFTP_USER@$SFTP_HOST<<-'EOF'
mget FILENAME$YESTERDAYS_DATE.txt
EOF


But unfortunately SFTP treating $YESTERDAYS_DATE as a string. My file name is something like FILENAME20190815.txt. Can please someone help me to achieve this.










share|improve this question
















I am trying to download yesterday's files from the server using a bash file with the following code:



   export SSHPASS=$SFTP_PASS
YESTERDAYS_DATE=`$DATE -d "-1 day" +"%Y%m%d"`

sshpass -e sftp -oBatchMode=no -b - $SFTP_USER@$SFTP_HOST<<-'EOF'
mget FILENAME$YESTERDAYS_DATE.txt
EOF


But unfortunately SFTP treating $YESTERDAYS_DATE as a string. My file name is something like FILENAME20190815.txt. Can please someone help me to achieve this.







shell-script ssh sftp here-document






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Kevdog777

2,13213 gold badges35 silver badges61 bronze badges




2,13213 gold badges35 silver badges61 bronze badges










asked 2 days ago









BASEER HAIDER JAFRIBASEER HAIDER JAFRI

1204 bronze badges




1204 bronze badges





put on hold as off-topic by Jeff Schaller yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – Jeff Schaller










put on hold as off-topic by Jeff Schaller yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – Jeff Schaller








put on hold as off-topic by Jeff Schaller yesterday


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – Jeff Schaller









  • 1





    Possibly due to the quotes around 'EOF'. See stackoverflow.com/questions/4937792/…

    – xenoid
    2 days ago











  • @xenoid you are absolutely right...Thank you for your help

    – BASEER HAIDER JAFRI
    2 days ago











  • Crossposted on Stack Overflow: stackoverflow.com/q/57562853/850848

    – Martin Prikryl
    yesterday














  • 1





    Possibly due to the quotes around 'EOF'. See stackoverflow.com/questions/4937792/…

    – xenoid
    2 days ago











  • @xenoid you are absolutely right...Thank you for your help

    – BASEER HAIDER JAFRI
    2 days ago











  • Crossposted on Stack Overflow: stackoverflow.com/q/57562853/850848

    – Martin Prikryl
    yesterday








1




1





Possibly due to the quotes around 'EOF'. See stackoverflow.com/questions/4937792/…

– xenoid
2 days ago





Possibly due to the quotes around 'EOF'. See stackoverflow.com/questions/4937792/…

– xenoid
2 days ago













@xenoid you are absolutely right...Thank you for your help

– BASEER HAIDER JAFRI
2 days ago





@xenoid you are absolutely right...Thank you for your help

– BASEER HAIDER JAFRI
2 days ago













Crossposted on Stack Overflow: stackoverflow.com/q/57562853/850848

– Martin Prikryl
yesterday





Crossposted on Stack Overflow: stackoverflow.com/q/57562853/850848

– Martin Prikryl
yesterday










1 Answer
1






active

oldest

votes


















0













I would change your variable around some. I messed with this 'yesterday' thing today as well..



YESTERDAYS_DATE=$(date -d "-1 day" +"%Y%m%d")

echo FILENAME$YESTERDAYS_DATE.txt


output: FILENAME20190818.txt






share|improve this answer








New contributor



acidic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • 2





    This would be more useful to the OP if you showed it in the context of their quoted here-document example. See also xenoid's pertinent comment.

    – Jeff Schaller
    2 days ago




















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0













I would change your variable around some. I messed with this 'yesterday' thing today as well..



YESTERDAYS_DATE=$(date -d "-1 day" +"%Y%m%d")

echo FILENAME$YESTERDAYS_DATE.txt


output: FILENAME20190818.txt






share|improve this answer








New contributor



acidic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • 2





    This would be more useful to the OP if you showed it in the context of their quoted here-document example. See also xenoid's pertinent comment.

    – Jeff Schaller
    2 days ago
















0













I would change your variable around some. I messed with this 'yesterday' thing today as well..



YESTERDAYS_DATE=$(date -d "-1 day" +"%Y%m%d")

echo FILENAME$YESTERDAYS_DATE.txt


output: FILENAME20190818.txt






share|improve this answer








New contributor



acidic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • 2





    This would be more useful to the OP if you showed it in the context of their quoted here-document example. See also xenoid's pertinent comment.

    – Jeff Schaller
    2 days ago














0












0








0







I would change your variable around some. I messed with this 'yesterday' thing today as well..



YESTERDAYS_DATE=$(date -d "-1 day" +"%Y%m%d")

echo FILENAME$YESTERDAYS_DATE.txt


output: FILENAME20190818.txt






share|improve this answer








New contributor



acidic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









I would change your variable around some. I messed with this 'yesterday' thing today as well..



YESTERDAYS_DATE=$(date -d "-1 day" +"%Y%m%d")

echo FILENAME$YESTERDAYS_DATE.txt


output: FILENAME20190818.txt







share|improve this answer








New contributor



acidic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this answer



share|improve this answer






New contributor



acidic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








answered 2 days ago









acidicacidic

11 bronze badge




11 bronze badge




New contributor



acidic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




acidic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • 2





    This would be more useful to the OP if you showed it in the context of their quoted here-document example. See also xenoid's pertinent comment.

    – Jeff Schaller
    2 days ago














  • 2





    This would be more useful to the OP if you showed it in the context of their quoted here-document example. See also xenoid's pertinent comment.

    – Jeff Schaller
    2 days ago








2




2





This would be more useful to the OP if you showed it in the context of their quoted here-document example. See also xenoid's pertinent comment.

– Jeff Schaller
2 days ago





This would be more useful to the OP if you showed it in the context of their quoted here-document example. See also xenoid's pertinent comment.

– Jeff Schaller
2 days ago



Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...