Monday, June 21, 2021

Copy Top 'Latest Modified 10 Files" from Linux Server and Download it to Local Laptop

https://stackoverflow.com/questions/15691359/how-can-i-list-ls-the-5-last-modified-files-in-a-directory

https://stackoverflow.com/questions/16886179/scp-or-sftp-copy-multiple-files-with-single-command

https://stackoverflow.com/questions/1706882/get-the-date-a-day-before-current-time-in-bash


---------------------------------------------------------------------------------------

ssh kk@10.102.20.43                                                                

---------------------------------------------------------------------------------------

cd /efs/datadrive/app-data/vea/output/reports                                

---------------------------------------------------------------------------------------

ls -1t | head -8                                         # Its One 1 , not "L"       

---------------------------------------------------------------------------------------

ls -1t | head -8 | tail -7                               # date +%d-%m-%Y            

---------------------------------------------------------------------------------------

date +%d-%m-%Y -d "2 day ago"                            # date --date='-2 day'    

---------------------------------------------------------------------------------------

mkdir -p                                        # xargs  date +%d-%m-%Y -d "2 day"   

---------------------------------------------------------------------------------------

zip                                                                                

---------------------------------------------------------------------------------------

scp 703250313@10.102.20.43:/efs/datadrive/app-data/vea/output/reports/21-6-2021.csv .

---------------------------------------------------------------------------------------

No comments:

Post a Comment

Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass